Docs/APIs/Test Card Generator

Test Card Generator

Generate test card numbers

OperationalCredits 1 per callp50 773msData GenerationStar

Overview

Card Generator works by generating valid test/sample card numbers based on the specified brand and count. It uses predefined rules and algorithms to generate the card numbers, then returns the list of generated card numbers in a structured format.

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

GEThttps://api.apiverve.com/v1/cardgenerator
curl "https://api.apiverve.com/v1/cardgenerator?brand=visa&count=5&includeAvatar=true" \
  -H "x-api-key: your_api_key_here"
const res = await fetch('https://api.apiverve.com/v1/cardgenerator?brand=visa&count=5&includeAvatar=true', {
  headers: { 'x-api-key': 'your_api_key_here' },
});

if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);

const { data } = await res.json();
console.log(data);
import requests

res = requests.get(
    "https://api.apiverve.com/v1/cardgenerator?brand=visa&count=5&includeAvatar=true",
    headers={"x-api-key": "your_api_key_here"},
    timeout=15,
)
res.raise_for_status()

print(res.json()["data"])
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/cardgenerator?brand=visa&count=5&includeAvatar=true", nil)
	req.Header.Set("x-api-key", "your_api_key_here")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
brandRequiredstringThe brand of the card to generate
visamastercardamexdiscoverjcbdinersunionpay
default visa
countOptionalPremiumintegerThe number of test card numbers to generate
default 1 · range 1–100
includeAvatarOptionalPremiumbooleanInclude an AI-generated face avatar for the card owner

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "brand": "visa",
    "count": 5,
    "cards": [
      {
        "cvv": 175,
        "issuer": "SOUTHEAST F.C.U.",
        "id": "0faca124-9a33-4ac6-a3df-8bf103025779",
        "number": "4750377207233152",
        "expiration": "12/2030",
        "brand": "visa",
        "number_alt": {
          "masked": "************3152",
          "unmasked": "4750 3772 0723 3152",
          "last4": "3152"
        }
      },
      {
        "cvv": 129,
        "issuer": "U.S. BANK, N.A.",
        "id": "0d074efe-69e2-4e30-b49a-4cead1ea8411",
        "number": "4431387818727358",
        "expiration": "12/2030",
        "brand": "visa",
        "number_alt": {
          "masked": "************7358",
          "unmasked": "4431 3878 1872 7358",
          "last4": "7358"
        }
      },
      {
        "cvv": 249,
        "issuer": "AUGUSTA VAH F.C.U.",
        "id": "2f01f458-7422-400e-bbcf-41364564193b",
        "number": "4425919427248836",
        "expiration": "12/2030",
        "brand": "visa",
        "number_alt": {
          "masked": "************8836",
          "unmasked": "4425 9194 2724 8836",
          "last4": "8836"
        }
      },
      {
        "cvv": 892,
        "issuer": "CITIZENS SECURITY BANK AND TRUST COMPANY",
        "id": "d311e9d0-f410-4f75-a21f-f14125c88cbb",
        "number": "4127737519045634",
        "expiration": "12/2030",
        "brand": "visa",
        "number_alt": {
          "masked": "************5634",
          "unmasked": "4127 7375 1904 5634",
          "last4": "5634"
        }
      },
      {
        "cvv": 524,
        "issuer": "CREDIT LIBANAIS S.A.L.",
        "id": "64113f4d-c625-43d2-9d82-04f220c9e26f",
        "number": "4741441509416816",
        "expiration": "12/2030",
        "brand": "visa",
        "number_alt": {
          "masked": "************6816",
          "unmasked": "4741 4415 0941 6816",
          "last4": "6816"
        }
      }
    ],
    "owner": {
      "name": "Benny Swaniawski",
      "address": {
        "street": "007 Nelson Mountains",
        "city": "Margueriteton",
        "state": "Washington",
        "zipCode": "39956-7950"
      },
      "avatar": "https://storage.googleapis.com/apiverve/APIResources/faces/Male/30-40/12345678.jpg?X-Goog-Signature=..."
    }
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
brandstring"visa"Card brand for generated test cards
countnumber5Total number of generated test cards
cardsarray[5]Array of generated test card objects with details
cvvnumber175Card verification value security code
issuerstring"SOUTHEAST F.C.U."Financial institution that issued the card
idstring"0faca124-9a33-4ac6-a3df-8bf103025779"Unique identifier for generated card
numberstring"4750377207233152"Full test card number for payment testing
expirationstring"12/2030"Card expiration date in MM/YYYY format
brandstring"visa"Card brand identifier (visa, mastercard, etc)
number_altobject{...}
maskedstring"************3152"Card number with asterisks masking sensitive digits
unmaskedstring"4750 3772 0723 3152"Card number formatted with spaces for readability
last4string"3152"Last four digits of card number
ownerPremiumobject{...}Cardholder owner information and address details
namePremiumstring"Benny Swaniawski"Full name of the card owner
addressPremiumobject{...}
streetPremiumstring"007 Nelson Mountains"Street address of card owner
cityPremiumstring"Margueriteton"City of card owner residence
statePremiumstring"Washington"State of card owner residence
zipCodePremiumstring"39956-7950"Postal zip code of card owner
avatarPremiumstring"https://storage.googleapis.com/apiverve/APIResources/faces/Male/30-40/12345678.jpg?X-Goog-Signature=..."URL to AI-generated face avatar image

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Payment Gateway Testing
Use the Card Generator API to generate test card numbers for payment gateway testing. Use the data to simulate transactions, test payment processing, and validate payment gateways
E-commerce Platforms
Generate test card numbers by using the Card Generator API for e-commerce platforms. Use the data to test checkout processes, verify payment methods, and ensure secure transactions
Financial Services
Generate sample card numbers by using the Card Generator API for financial services. Use the data to test card validation, verify cardholder information, and prevent fraudulent transactions
Fraud Prevention
Prevent fraud by using the Card Generator API to generate test card numbers. Use the data to identify vulnerabilities, test security measures, and protect against scams

Other ways to use Test Card Generator

Set up Test Card Generator on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKitReference →
Use it in Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheetsReference →

More in Data Generation:

Was this page helpful?