BIN API (Card Payment)

Obtain user's card properties information based on BIN (Bank Identification Number)


BIN API is called to get metadata for a particular BIN, such as card type (Credit or Debit), the card network provider (Visa, MasterCard), and so on. BIN API is available for in both Snap and Core API integrations.



BIN API Method

See sample on the right -- try it yourself!

HTTP MethodEndpointDefinition
GETBASE_URL/v1/bins/bin_numberGet Bin Metadata.


BIN API Response

{
    "data": {
        "country_name": "Indonesia",
        "country_code": "id",
        "brand": "visa",
        "bin_type": "credit",
        "bin_class": "gold",
        "bin": "45563300",
        "bank_code": "bca",
        "bank": "bank central asia"
    }
}
JSON AttributeDescriptionTypeRequired
dataInformation about the card.ObjectConditional
   country_nameName of the country from which the card is issued. For example, Indonesia. StringOptional
   country_codeThe country code. For example, id.StringOptional
   brandThe card network provider. For example, visa.StringOptional
   bin_typeThe type of BIN. For example, credit. StringRequired
   bin_classThe class of BIN. For example, gold.StringOptional
   binRequested Bin number. For example, 455633.StringRequired
   bank_codeThe three letter bank code. For example, bca.StringOptional
   bankName of the bank on the card. For example, Bank Central Asia.StringOptional


Authorization Header

The request is authorized using the same method as HTTP(S) Request. Either the Midtrans Client Key or Midtrans Server key can be used.

It is highly recommended to use Midtrans Client Key if the request is made from a browser or a mobile device.



Rate Limit

Bin requests are rate-limited by 100 requests per minute. If the number of attempted requests exceeds the limit, Midtrans API responds with 409 status code.



Response Codes

CodeDescription
200OK.
404Particular Bin does not exist.
401Credential is empty or wrong. Please recheck the authorization configuration.
409Request exceeds the rate limit.


Response Object

JSON AttributeDescriptionTypeRequired
bankThe name of the bank on the card. For example, Bank Central Asia.StringOptional
bank_codeThe bank code. For example, bca.StringOptionalbca
binThe requested Bin number. For example, 455633.StringRequired
bin_typeThe type of payment card. For example, credit or debit.StringRequiredcredit
bin_classCard Class. For example, gold.StringOptional
brandThe name of the bank issuing the payment card. For example, visa.StringOptional
country_nameCountry issuing the payment card. For example, Indonesia.StringOptional
country_codeCode name of the country issuing the payment card. For example, id.StringOptional
registration_required[DEPRECATED - please use with your own discretion as data from some banks might not be the most updated]Indicate which card needs to be registered with the bank provider for use in online transactions.

For example, true, falseor null
BooleanOptional
Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!