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.

Guides: Node.js · Python

Request Body

{
  "number": "4111111111111111"
}

Example Request

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"number": "4111111111111111"}' \
  "https://api.isvalid.dev/v0/credit-card"

Response Fields

FieldTypeDescription
validbooleanWhether the card number passes the Luhn check
typestringDetected card type: visa, mastercard, amex, discover, diners, jcb, unionpay, or unknown

Example Response

{
  "valid": true,
  "type": "visa"
}