API Almanac
API reference › Validate

Check a payment card number: Luhn checksum, brand and length (nothing is stored)

GET/v1/validate/card

GET/v1/validate/card

Check a payment card number: Luhn checksum, brand and length (nothing is stored)

Use it to catch typos before a payment form submits. It says nothing about whether the account exists or has funds.

PARAMETERS
numberquery · stringREQUIRED
Card number, spaces or dashes allowed
e.g. 4111 1111 1111 1111
In the full reference
REQUEST
curl "https://api.apialmanac.com/v1/validate/card?number=4111+1111+1111+1111" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "valid": true,
  "luhn": true,
  "brand": "Visa",
  "length": 16,
  "bin": "411111",
  "last4": "1111",
  "masked": "4111 •••• •••• 1111",
  "reason": null
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.