Mask a card number
Format a card number into the conventional display groups for its network (4-6-5 for Amex, 4-6-4 for 14-digit Diners, otherwise groups of four).
- Category
- Data & research
- Starting price
- $0.002
- Paid calls · 30 days
- 10
- Unique payers · 30 days
- 10
Paid endpoints
5 endpoints, sorted by usage. Prices are per request.
- POST/v1/format
Format a card number into the conventional display groups for its network (4-6-5 for Amex, 4-6-4 for 14-digit Diners, otherwise groups of four).
$0.002Base2calls / 30d - POST/v1/generate
Generate a random Luhn-valid TEST card number for the given network (default Visa). For testing only — these are not issued cards and cannot be charged. The response is always flagged `test:true`.
$0.002Base2calls / 30d - POST/v1/network
Detect the issuing network/brand (Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay, Maestro) from the card's IIN prefix, with the network's valid lengths. Returns `network:null` for an unrecognized prefix.
$0.002Base2calls / 30d - POST/v1/mask
Mask a card number for display, keeping the first six and last four digits (the PCI-permitted maximum) and replacing the rest with a mask character (default `*`).
$0.002Base2calls / 30d - POST/v1/validate
Validate a payment-card number: Luhn check-digit test plus network detection and length check. A syntactically valid number that fails Luhn returns `valid:false` (a 200, not an error).
$0.002Base2calls / 30d