Card BIN Verification
Check if a card is valid before making a payment.
Every debit or credit card has a BIN (Bank Identification Number)—the first six digits of the card number; the BIN identifies the issuing bank's name and location, as well as the type of card. This makes the BIN ideal for validating a card before starting a payment transaction or giving value.
You can verify card BINs with our resolve card BIN endpoint by passing in the card BIN in the URL. This endpoint is also supported by some of our backend SDKs.
# Install with: gem install flutterwave_sdk
require 'flutterwave_sdk'
flw = Flutterwave.new(ENV["FLW_PUBLIC_KEY"], ENV["FLW_SECRET_KEY"], ENV["FLW_ENCRYPTION_KEY"])
misc = Misc.new(flw)
card_number = '5531886652142950'
card_bin = card_number[0...6]
response = misc.resolve_card_bin card_bin
print response
curl --request GET 'https://api.flutterwave.com/v3/card-bins/553188' \
--header 'Authorization: Bearer YOUR SECRET_KEY'
We'll return details about the issuer and card type:
{
"status": "success",
"message": "completed",
"data": {
"issuing_country": "NIGERIA NG",
"bin": "553188",
"card_type": "MASTERCARD",
"issuer_info": " CREDIT"
}
}
Sample of invalid response:
{
"status": "error",
"message": "completed",
"data": {
"nigerian_card": false,
"response_code": "RR",
"response_message": "BIN not Found",
"transaction_reference": "FLW1590500367800"
}
}
Updated about 1 month ago