The v2 Get BIN Info API is used to determine the following for a single card or multiple cards:
- Card's issuing bank
- Card type such as, Visa, Master, etc.
- Card category such as Credit/Debit, etc.
- Cards with zero redirect support
- Cards with SI support
You can fetch cards details with the following specific feature-level information:
- Complete BIN list having ATM PIN support is required
- Complete BIN list with OTP-on-the-fly support (IVR) is required
When fetching multiple card details, you can limit the number of card details in the response using the start index and offset.
Environment
Test Environment | https://test.payu.in/issuing-bank/v1/bin |
Production Environment | https://info.payu.in/issuing-bank/v1/bin |
Request header
Parameter | Description |
---|---|
date | The current date and time. For example, format of the date is Wed, 28 Jun 2023 11:25:19 GMT. |
authorization | The actual HMAC signature generated using the specified algorithm (sha512) and includes the hashed data. For more information, refer to authorization fields description. |
authorization fields description
Field | Description |
---|---|
username | Represents the username or identifier for the client or merchant, for example smsplus. |
algorithm | Use SHA512 algorithm for hashing and send this as header value. |
headers | Specifies which headers have been used in generating the hash, for example date. |
signature | The HMAC signature generated using the specified algorithm. For more information, refer to hashing algorithm. |
hashing algorithm
You must hash the request parameters using the following hash logic:
Hash logic: sha512(<Body data>
+ '|' + date + '|' + merchant_secret)
Where <Body data>
contains the request body posted with the request.
Sample header code
var merchant_key = 'smsplus';
var merchant_secret = 'izF09TlpX4ZOwmf9MvXijwYsBPUmxYHD';
// date
var date = new Date();
date = date.toUTCString();
// authorization
var authorization = getAuthHeader(date);
function getAuthHeader(date) {
var AUTH_TYPE = 'sha512';
var data = isEmpty(request['data']) ? "" : request['data'];
var hash_string = data + '|' + date + '|' + merchant_secret;
var hash = CryptoJS.SHA512(hash_string).toString(CryptoJS.enc.Hex);
return `hmac username="${merchant_key}", algorithm="${AUTH_TYPE}", headers="date", signature="${hash}"`;
}
Request body
Parameter | Description | Example |
---|---|---|
binmandatory |
Integer Specific output request type:• 1: Fetch information for a single BIN level. • 2: Fetch specific feature-level BIN list. • 3: Fetch all BIN and related information. |
1 |
Sample request
curl --location 'https://info.payu.in/issuing-bank/v1/bin' \
--header 'Content-Type: application/json' \
--header 'date: {{date}}' \
--header 'Authorization: {{authorization}}' \
--data '{
"bin": "512345"
}'
Response parameters
Parameter | Description |
---|---|
status | This parameters provides the response whether the API was successful or not. This response value can contain any of the following: • 0 signifies that the API was not successful or invalid details. • 1 signifies that the API was successful in fetching the details. |
data | The card details are displayed in a JSON format. For more information, refer to the next table. |
Card Details in bins_data Field
For multiple cards, the card details in the bins_data field are in a JSON array format, and fields in each JSON are described in the following table. For a single card, only the fields are displayed in JSON format.
Enable additionalCardType parameter:To receive the response for the additionalCardType parameter or enable this parameter, you need to contact your PayU Key Account Manager (KAM) or PayU Support.
Field | Description |
---|---|
issuingBank | The issuing bank of the card used for the transaction |
bin | The BIN number of the card is displayed in the response. |
category | Response value can contain any of the following: • creditcard signifies that the particular bin is a credit card BIN • debitcard signifies that the particular bin is a debit card BIN |
card_type | Response value can contain any of the following: • MAST • VISA • MAES • AMEX • DINR • Unknown |
isDomestic | Response value can contain any of the following: • 1 signifies that the particular BIN is Domestic. • 0 signifies that the particular BIN is International. |
additonalCardType | The response contains any of the following values to show if it is corporate or prepaid card: • CE - Corporate card • PE - Prepaid card Note: To receive the response for this parameter or enable this parameter, you need to contact your PayU Key Account Manager (KAM) or PayU Support. |
is_atmpin_card | Response value can contain any of the following: • 0 signifies that the card is not an ATM card. • 1 signifies that the card is an ATM card. |
is_otp_on_the_fly | Response value can contain any of the following: • 0 signifies that the card does not have OTP on the fly facility. • 1 signifies that the card have OTP on the fly facility. |
messageVersion | Response value will contain the 3DS version supported by the CardBin/CardNumber. For example, it can be any of the following: • 1.0.2 • 2.1.0 • 2.2.0 Note: This response parameter value is shown only if var7 parameter value is posted in the request. |
To learn more about the possible error codes and their description, refer to Error Codes.
Sample response
Array
(
[status] => 1
[data] => Array
(
[bins_data] => Array
(
[issuing_bank] => HDFC
[bin] => 512345
[category] => creditcard
[card_type] => MAST
[is_domestic] => 1
[is_atmpin_card] => 1
[is_otp_on_the_fly] => 1
[is_zero_redirect_supported] => 1
[is_si_supported] => 0
)
)
)