Check is Domestic API

Check is Domestic (Card BIN) API

The Check is Domestic or Card BIN API is used to detect whether a particular BIN number is international or domestic. It is also useful to determine:

  • Card's issuing bank
  • Card type such as, Visa, Master, etc.
  • Card category such as Credit/Debit, etc.
  • var1 is bin number which is the first 6 digits of a Credit/Debit card.

Environment

Sample request
curl -X POST "https://test.payu.in/merchant/postservice?form=2" \
-H "accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=JP***g&command=check_isDomestic&var1=462273&hash=df4ff56008defd9d7f9bf09506061f5c790dbe1d011659d85b88d34323ff49a65181e522eddf3075285c17708566709c803d3b0b0979120804b00f62236062a2"

Example Values:

  • var1 (first six digit of the card): 512345
Sample response

If the card is domestic

{
  "isDomestic": "Y",
  "issuingBank": "SCB",
  "cardType": "VISA",
  "cardCategory": "CC"
}

If the card is international

{
  "isDomestic": "N",
  "issuingBank": "UNKNOWN",
  "cardType": "Unknown",
  "cardCategory": "CC"
}
Response parameters
ParameterDescription
isDomesticResponse value can contain any of the following: • Y signifies that the particular BIN is domestic. • N signifies that the particular BIN is International.
cardTypeResponse value can contain any of the following: • MAST • VISA • MAES • AMEX • DINER • Unknown
issuingBankThe issuing bank of the card used for the transaction.
cardCategoryResponse value can contain any of the following: • CC signifies that the particular bin is a credit card BIN • DC signifies that the particular bin is a debit card BIN

To learn more about the possible error codes and their description, refer to Error Codes.

Request parameters

Additional information for request parameters

Reference Information for Request Parameters

ParameterReference
keyFor more information on how to generate the Key and Salt, refer to any of the following: • Production: Generate Merchant Key and SaltTest: Generate Test Merchant Key and Salt
hashHash logic for this API is: sha512(key|command|var1|salt) sha512
var1For JSON fields description, refer to Additional Info for General APIs

Request Parameters Description

ParameterDescription
keyMerchant key provided by PayU for authentication
commandSet to "check_isDomestic" for this API
var1The first 6 digits of the Credit/Debit card (BIN number)
hashSecurity hash calculated using sha512 algorithm

Example Values

Use the following sample values while trying out the API:

  • var1 (first six digit of the card): 512345

Important Notes:

  1. BIN Number: The var1 parameter should contain exactly the first 6 digits of the card number
  2. Domestic vs International:
    • Domestic cards (isDomestic: "Y") will show detailed issuing bank information
    • International cards (isDomestic: "N") typically show "UNKNOWN" for issuing bank
  3. Card Types: The API supports detection of major card types including VISA, MAST, AMEX, MAES, DINER
  4. Card Categories: Distinguishes between Credit Cards (CC) and Debit Cards (DC)
  5. Hash Calculation: Use the sha512 algorithm with the format: key|command|var1|salt
Language
Click Try It! to start a request and see the response here!