Aller au contenu principal

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

FieldTypeRequiredDescription
cardNumberstringYesCredit 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

FieldTypeDescription
validbooleanOverall validity (Luhn check passes and brand recognized)
luhnValidbooleanWhether the number passes the Luhn checksum algorithm
cardBrandstringDetected card brand (see table below)
lastFourDigitsstringLast four digits of the card number
cardTypestringCard type from BIN lookup (CREDIT, DEBIT, or PREPAID)
issuingBankstringName of the issuing bank (via BIN lookup)
cardCountrystringCountry of the issuing bank (ISO 3166-1 alpha-2)
cardCategorystringCard category tier (not currently populated; reserved for future use)

Card Brands

BrandPrefix Pattern
VisaStarts with 4
MasterCardStarts with 51-55 or 2221-2720
AmericanExpressStarts with 34 or 37
DiscoverStarts with 6011 or 65
DinersClubStarts with 300-305, 36, or 38
JCBStarts with 3528-3589
UnknownUnrecognized prefix

Card Types

TypeDescription
CREDITCredit card
DEBITDebit card
PREPAIDPrepaid 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