> ## Documentation Index
> Fetch the complete documentation index at: https://flutterwaveinc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](/api-reference/misc/verify-bvn-consent) endpoint by passing in the card BIN in the URL. This endpoint is also supported by some of our [backend SDKs](/sdk-plugins/backend-libraries/nodejs).

<CodeGroup>
  ```ruby Ruby theme={null}
  # 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
  ```

  ```json cURL theme={null}
  curl --request GET 'https://api.flutterwave.com/v3/card-bins/553188' \
    --header 'Authorization: Bearer YOUR SECRET_KEY'
  ```
</CodeGroup>

We'll return details about the issuer and card type:

<CodeGroup>
  ```json Valid BIN theme={null}
  {
  	"status": "success",
  	"message": "completed",
  	"data": {
  		"issuing_country": "NIGERIA NG",
  		"bin": "553188",
  		"card_type": "MASTERCARD",
  		"issuer_info": " CREDIT"
  	}
  }
  ```
</CodeGroup>

Sample of invalid response:

<CodeGroup>
  ```json Invalid BIN theme={null}
  {
    "status": "error",
    "message": "completed",
    "data": {
      "nigerian_card": false,
      "response_code": "RR",
      "response_message": "BIN not Found",
      "transaction_reference": "FLW1590500367800"
    }
  }
  ```
</CodeGroup>
