Credit Card Validation
Validate credit card numbers using the Luhn algorithm and identify the card brand. Includes BIN lookup for issuing bank and card category. No charges, authorization, or payment network connections are made.
Endpoint
POST /api/v1/creditcard/validate
Authentication
All requests require an API key passed via the X-Api-Key header.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
cardNumber | string | Yes | Credit card number (digits only or with spaces/dashes) |
{
"cardNumber": "4539578763621486"
}
Response
{
"valid": true,
"luhnValid": true,
"cardBrand": "Visa",
"lastFourDigits": "1486",
"cardType": "CREDIT",
"issuingBank": "Chase",
"cardCountry": "US",
"cardCategory": null
}
Response Fields
| Field | Type | Description |
|---|---|---|
valid | boolean | Overall validity (Luhn check passes and brand recognized) |
luhnValid | boolean | Whether the number passes the Luhn checksum algorithm |
cardBrand | string | Detected card brand (see table below) |
lastFourDigits | string | Last four digits of the card number |
cardType | string | Card type from BIN lookup (CREDIT, DEBIT, or PREPAID) |
issuingBank | string | Name of the issuing bank (via BIN lookup) |
cardCountry | string | Country of the issuing bank (ISO 3166-1 alpha-2) |
cardCategory | string | Card category tier (not currently populated; reserved for future use) |
Card Brands
| Brand | Prefix Pattern |
|---|---|
Visa | Starts with 4 |
MasterCard | Starts with 51-55 or 2221-2720 |
AmericanExpress | Starts with 34 or 37 |
Discover | Starts with 6011 or 65 |
DinersClub | Starts with 300-305, 36, or 38 |
JCB | Starts with 3528-3589 |
Unknown | Unrecognized prefix |
Card Types
| Type | Description |
|---|---|
CREDIT | Credit card |
DEBIT | Debit card |
PREPAID | Prepaid card |
Example
curl -X POST \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cardNumber": "4539578763621486"}' \
"https://api.iqxlookup.neivi.es/api/v1/creditcard/validate"
Notes
- This endpoint performs structural validation only -- it does not contact payment networks or process transactions
- Card numbers are sanitized: spaces, dashes, and other non-digit characters are stripped before validation
- The full card number is never returned in the response; only the last four digits are included
- Card numbers are not logged or stored