Credit Card
POST/v0/credit-card
Validates credit card numbers using the Luhn algorithm. Accepts cards from Visa, Mastercard, American Express, Discover, JCB, Diners Club, and UnionPay. The card number is sent in the request body to avoid logging sensitive data in server access logs.
Request Body
{
"number": "4111111111111111"
}Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/credit-card"
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the card number is valid |
| network | string | Detected card network (e.g. Visa, Mastercard, Amex) |
| length | number | Number of digits in the card number |
| luhn | boolean | Whether the number passes the Luhn checksum |
Example Response
{
"valid": true,
"network": "Visa",
"length": 16,
"luhn": true
}