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.


📘

Important Note

BIN data is sourced directly from card principals (Visa, Mastercard, JCB, etc.) and issuing banks. As such, certain values (e.g., bank name, capitalization, or length) may change over time or sometimes be empty.

We recommend not treating BIN values as part of a strict contract or using them for validation, since these fields are subject to unannounced changes. Instead, BIN data should be considered as informational and advisory, to help with general use cases such as UI display or analytics.


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 Attribute

Description

Type

Required

bank

The name of the bank on the card. For example, Bank Central Asia.

String

Optional

bank_code

The bank code. For example, bca.

String

Optional

bca

bin

The requested Bin number. For example, 455633.

String

Required

bin_type

The type of payment card. For example, credit or debit.

String

Required

credit

bin_class

Card Class. For example, gold.

String

Optional

brand

The name of the bank issuing the payment card. For example, visa.

String

Optional

country_name

Country issuing the payment card. For example, Indonesia.

String

Optional

country_code

Code name of the country issuing the payment card. For example, id.

String

Optional

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

Boolean

Optional

Language
Credentials
Basic
base64
:
Click Try It! to start a request and see the response here!