Skip to content
moxon home

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.

gethttps://api.moxon.dev/v5/credit
Try itget/v5/credit

Parameters

  • brandstringoptional

    Default: random.

    Card brand: visa, mastercard, amex, discover

    • random
    • visa
    • mastercard
    • amex
    • discover
  • countnumberoptional

    Default: 1.

    Number of cards to generate (1–10)

  • format"masked" | "full"optional

    Default: masked.

    Output 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:

  • numberstring

    Card number, masked or full depending on format

  • formattedstring

    Human-readable card number with spaces (e.g. 4532 **** **** 1234)

  • brandstring

    Card brand (visa, mastercard, amex, discover)

  • expirystring

    Expiration date in MM/YY format

  • cvvstring

    Security code (3 digits, 4 for Amex)

  • luhnboolean

    Always true — the number passes the Luhn checksum

Code Examples

Error Handling

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