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 allowede.g. 4111 1111 1111 1111
REQUEST
curl "https://api.apialmanac.com/v1/validate/card?number=4111+1111+1111+1111" \ -H "X-API-Key: YOUR_KEY"
import requests
r = requests.get("https://api.apialmanac.com/v1/validate/card?number=4111+1111+1111+1111", headers={"X-API-Key": "YOUR_KEY"})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.apialmanac.com/v1/validate/card?number=4111+1111+1111+1111", {
headers: { "X-API-Key": "YOUR_KEY" }
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200OK
{
"valid": true,
"luhn": true,
"brand": "Visa",
"length": 16,
"bin": "411111",
"last4": "1111",
"masked": "4111 •••• •••• 1111",
"reason": null
}