Skip to main content

Introduction

BIN Lookup allows you to retrieve card information by providing the first 8 digits of a card number. This helps you identify card network, type, bank, and issuance details before processing a payment, enabling better user experience and payment flow optimization.

Card Network Detection

Identify card network (visa, mastercard, rupay, etc.) instantly

Card Type Identification

Determine if the card is credit or debit

Bank Information

Get bank name and domestic/international status

Use Cases

  • Pre-validation: Validate card details before submitting payment
  • UI Enhancement: Display card network logo or bank name as user types
  • Payment Flow Optimization: Determine payment method eligibility
  • Fraud Prevention: Identify potentially suspicious cards early

Prerequisites

Before you begin, ensure you have:
  • Credentials: Your Client ID and Client Secret
  • API Access: BIN lookup endpoint access enabled for your account

Step 1: Lookup BIN

Send a POST request to /pg/bin/ with the BIN code (first 8 digits of the card number).

Request Example

JavaScript Example

Python Example

Step 2: Handle Response

Success Response

Response Fields

  • bank: Bank name that issued the card
  • network: Card network - visa, mastercard, rupay, amex, diners, maestro, sbi_maestro
  • card_type: Card type - credit_card or debit_card
  • is_domestic: Boolean indicating if card is issued in India

Error Handling

Integration Example: Real-time Card Detection

Here’s a complete example of integrating BIN lookup in a card input form:

Best Practices

  1. Debounce Requests: Wait for user to stop typing before making BIN lookup requests
  2. Cache Results: Cache BIN lookup results to reduce API calls
  3. Handle Errors Gracefully: Don’t block payment flow if BIN lookup fails
  4. Validate BIN Format: Ensure BIN is 8 digits before making request
  5. Show Loading State: Display loading indicator during lookup

Error Codes