Skip to content

Credit Card Generation

The /credit endpoint generates fictitious credit card numbers for testing purposes. All numbers pass the Luhn checksum algorithm and use correct IIN prefixes per brand.

Parameters

ParameterRequiredDefaultDescription
brandNorandomCard brand: visa, mastercard, amex, discover
countNo1Number of cards to generate (1–10)
formatNomaskedOutput format: full (all digits) or masked (middle digits hidden with *)

Response Fields

The response contains a cards array. Each card object has the following fields:

FieldTypeDescription
numberstringCard number, masked or full depending on format
formattedstringHuman-readable card number with spaces (e.g. 4532 **** **** 1234)
brandstringCard brand (visa, mastercard, amex, discover)
expirystringExpiration date in MM/YY format
cvvstringSecurity code (3 digits, 4 for Amex)
luhnbooleanAlways true — the number passes the Luhn checksum

Code Examples

curl -X GET \
  "https://api.sylvain.sh/v4/credit?brand=visa&count=2&format=full"

Try It

Error Handling

Error MessageDescription
Unknown brand "{brand}". Valid options: visa, mastercard, amex, discoverThe brand value is not recognized
Count must be an integer between 1 and 10The count parameter is out of the allowed range
Format must be "full" or "masked"The format value is not valid