Skip to main content

Get card art

Use this API call to get the graphical material of the card issued to the cardholder. The flow is as defined below.

Notice that the flow is split up into two steps.

  1. The requester requests card art to a token given.

  2. Later when the card art is generated Cardtokens sends an async notification including the card art payload.

Get card art flow

Endpoint and method​

Method: GET

Endpoint: https://api.cardtokens.io/api/token/{tokenid}/cardart

Response parameters​

Parameter nameData typeDescription
urlStringThe full URL to where the notification is transmitted by HTTP POST including card art details.
tokencardartqueueidStringThe uniqueue reference to the enqueued request for card art.

Example response​

{
"url": "https://YOUR-DOMAIN-FOR-CARDART-NOTIFICATIONS/{tokenid}",
"tokencardartqueueid": "5f6463cbdf4b423590d916aab22f8e44"
}

Notification parameters​

info

Coming soon. Contact us at hello@cardtokens.io for more info.

Endpoint and method​

Method: POST

Endpoint: https://YOUR-DOMAIN-FOR-CARDART-NOTIFICATIONS/{tokenid}

Parameter nameData typeDescription
b64imageStringA base 64 encoded value of the PNG. This can be inserted directly into an IMG tag or decoded and written to file.
mimetypeStringThe http protocol formatting type of the image. Currently only image/png is available.
widthIntegerThe width of the image.
heightIntegerThe height of the image.
last4StringThe last 4 digits of the PAN.
expmonthIntegerThe expiry month of the token. N2 formatted as 12.
expyearIntegerThe expiry year of the token. Formatted as N4 (e.g. 2099).
issuerStringThe name of the bank which has issued the card.

Example payload​

{
"b64image": "iVBORw0KGgoAA………………AAGUCAYA=",
"mimetype": "image/png",
"height": 404,
"width": 640,
"expmonth": 2,
"expyear": 2028,
"last4": "6486",
"issuer": "Bank of Cardtokens"
}

How to display the image​

The base64 encoded image can be displayed in HTML using this format:

<img src="”data:{mimetype};base64," {b64image}” />

From the example, this will look like this:

<img src=”data:image/png;base64, iVBORw0KGgoAA………………AAGUCAYA=” />