post
https://{host}/v2/card/generate
Lets you generate cards for a card series in bulk.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
This API generates card numbers in bulk for a specific card series. Generated cards have a status NOT_ISSUED, and you can assign or issue them to customers later.
NoteFor detailed information about the APIs and for hands-on testing, refer to the API overview documentation and step-by-step guide on making your first API call.
Prerequisites
- Basic Authentication
- Default access group
Example request
curl --location 'https://eu.api.capillarytech.com/v2/card/generate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic =' \
--data '{
"seriesId":173,
"count": 5,
"statusLabel":"NOT_ISSUED"
}'Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
| seriesID | integer | Yes | Unique ID of the card series to generate cards. |
| count | integer | Yes | Number of cards to generate. Max 50,000 per request. |
| statusLabel | string | Optional | Status label to assign to the generated cards. Must be mapped to NOT_ISSUED. |
Example response
Successful generation (all cards new):
{
"data": [
"Test09000000000037end",
"Test09000000000036end",
"Test09000000000035end",
"Test09000000000034end",
"Test09000000000033end"
],
"warnings": [],
"errors": []
}Partial generation (some card numbers already exist):
{
"data": [
"Test09000000000037end",
"Test09000000000035end"
],
"warnings": [
{
"code": 3059,
"message": "Few Card numbers already exists",
"duplicates": [
"Test09000000000036end"
]
}
],
"errors": []
}Response parameters
| Field | Type | Description |
|---|---|---|
| data | Array | Array of successfully generated card numbers. Cards that already existed are excluded. |
| warnings | Array | Array of warning objects. Populated when some cards could not be created. |
.code | number | Warning code. |
.message | string | Warning message. |
.duplicates | Array | (Present when code is 3059) Card numbers that already existed in the database and were excluded from data. |
| errors | Array | Array of errors. |
Error & warning codes
| Code | Error number | Type | Description |
|---|---|---|---|
INVALID_CARD_SERIES | 3000 | Error | Invalid card series. The specified seriesId does not exist. HTTP 400. |
INVALID_CARD_STATUS_LABEL | 3017 | Error | Status label is invalid. HTTP 400. |
CARD_GEN_CARD_COUNT_INVALID | 3025 | Error | Count field is missing or zero. HTTP 400. |
CARD_GEN_CARD_COUNT_EXCEEDS | 3026 | Error | Card count exceeds the maximum limit of 50,000 per request. HTTP 400. |
FEW_CARDS_ALREADY_EXISTS | 3059 | Warning | Some generated card numbers already exist in the database. Duplicates are excluded from data and listed in warnings[].duplicates. Remaining new cards are returned normally. HTTP 200. |
— | 500 | Error | Internal server error. The server encountered an unexpected condition. HTTP 500. |
