Generate Cards

Lets you generate cards for a card series in bulk.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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.

👍

Note

For 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

FieldTypeRequiredDescription
seriesIDintegerYesUnique ID of the card series to generate cards.
countintegerYesNumber of cards to generate. Max 50,000 per request.
statusLabelstringOptionalStatus 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

FieldTypeDescription
dataArrayArray of successfully generated card numbers. Cards that already existed are excluded.
warningsArrayArray of warning objects. Populated when some cards could not be created.
.codenumberWarning code.
.messagestringWarning message.
.duplicatesArray(Present when code is 3059) Card numbers that already existed in the database and were excluded from data.
errorsArrayArray of errors.

Error & warning codes

CodeError numberTypeDescription
INVALID_CARD_SERIES3000ErrorInvalid card series. The specified seriesId does not exist. HTTP 400.
INVALID_CARD_STATUS_LABEL3017ErrorStatus label is invalid. HTTP 400.
CARD_GEN_CARD_COUNT_INVALID3025ErrorCount field is missing or zero. HTTP 400.
CARD_GEN_CARD_COUNT_EXCEEDS3026ErrorCard count exceeds the maximum limit of 50,000 per request. HTTP 400.
FEW_CARDS_ALREADY_EXISTS3059WarningSome 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.
500ErrorInternal server error. The server encountered an unexpected condition. HTTP 500.
Body Params
int32
required

Unique ID of the card series to generate cards.

int32
required

Number of cards to generate.

string
required

Current user defined status of the card. Check your user defined values for the system values (not issued, active, inactive, deleted, expired).

Response

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json