The native SDKs provide a convenient way to retrieve details about a particular card based on its BIN (Bank Identification Number), checkout country, currency, and other parameters. This allows you to identify the card brand, card type, and other relevant information before processing a payment.Documentation Index
Fetch the complete documentation index at: https://docs.gr4vy.com/llms.txt
Use this file to discover all available pages before exploring further.
Use cases
Get card details to:- Identify the card brand (Visa, Mastercard, etc.) as the user types
- Determine the card type (debit, credit, prepaid)
- Display the appropriate card logo in your UI
- Validate card compatibility with your payment processors
- Provide better user experience with card-specific information
Implementation
Create a request with card details (BIN, country, currency, amount) to retrieve information about the card.Best practices
- Use BIN lookup early: Retrieve card details as soon as you have the first 6 digits of the card number to provide instant feedback to users.
- Error handling: Always handle network and HTTP errors gracefully and show appropriate messages to users.
- Timeout configuration: Use custom timeouts for card details requests if your network conditions require it.
- Cache wisely: Consider caching card details for a short period to reduce API calls during the same checkout session.