Skip to main content

📄 Guide

Cardholders need a PIN to withdraw cash at an ATM and to pay at some offline POS terminals. As a licensed issuer with its own BINs, DCS treats setting a PIN as a sensitive operation that has to happen inside a trusted page: in the DeCard-Managed model, PINs are not set or updated through a direct API. Instead you send the user to a DCS-hosted H5 guidance page where they set the PIN themselves, so PIN entry and encryption both happen inside the DCS-hosted page and never touch your backend.
Prerequisite: you must already have issued the card and hold its cardId. If you are not yet sure how to apply for a card, read Issuing Cards first.

Mental model: why the PIN goes through a guidance page instead of an API

The DeCard-Managed model groups PIN setting with the operations an end user must complete in person inside a trusted page, alongside KYC, viewing sensitive card details and activating a physical card. All of them run through the same redirect guidance page (guidanceLink):
  1. Your backend calls the guidance page endpoint with the operation type (action / type) and the target card identifier, and receives a single-use guidance link.
  2. You redirect the user to that link.
  3. The user enters and submits the new PIN inside the DCS-hosted H5 page, which validates and encrypts it.
  4. When they are done, the page returns the user to your app at the redirect URL you supplied.
That way neither your client nor your backend ever handles the PIN in plaintext, which keeps your PCI and compliance burden low. The PIN page reuses the common guidance page endpoint, which identifies the card precisely with cardId.
The full parameter table and redirect mechanics for the guidance page endpoint are documented in one place, H5 KYC / Card Application Guidance Page. This page lists only the fields that matter for the PIN flow, to avoid duplication.

Request fields (PIN flow)

The required fields are action / externalUserId / successRedirectUrl / errorRedirectUrl / cardId. theme and mode are optional, but sending them every time is recommended, in line with the sibling page Viewing Encrypted Card Details. Four further fields belong to the full guidance page contract but are not used by the PIN flow: nationality (nationality, honoured only by KYC_GUIDE), selectNationalityShow (nationality selection page, honoured only by KYC_GUIDE), primaryColor (primary colour, a hex value starting with #) and applyId (required when uploading extra documents). For the complete field table, see H5 KYC / Card Application Guidance Page.

Request example (V2, masked)

Authentication: the example omits the authentication headers to keep the focus on the business fields. A real call must carry X-DAPI-API-KEY / X-DAPI-SIGN / X-DAPI-TIMESTAMP / X-DAPI-NONCE (HMAC-SHA256 signature); for the rules, see the Authentication Guide.
Every example value is a placeholder. Never put a real externalUserId, cardId, API key or secret, or any cardholder personal data into a request or a log.

Response

The guidance page endpoint returns the common envelope { code, message, messageDetail, data }. On success code = SYS_SUCCESS and data is the guidance page link, as a string. messageDetail is a message object (its schema has seven sub-fields: message / title / type / icon / action / linkTitle / linkUrl) used to carry structured messaging on failure; on success it is normally null.
On failure, messageDetail may come back in this shape (every sub-field is a string): { "message": "...", "title": "...", "type": "...", "icon": "...", "action": "...", "linkTitle": "...", "linkUrl": "..." }
Redirect the user to the link in data and they land on the DCS-hosted PIN page.

The full PIN-setting sequence

The full sequence for setting a PINThe full sequence for setting a PIN

Screenshots of the H5 PIN page

Once the user follows the guidance link, they set the PIN inside the DCS-hosted page. The flow looks like this (action=UPDATE_PIN):

Error handling

Whether the PIN was set successfully is determined by which URL the guidance page redirects to, successRedirectUrl or errorRedirectUrl. If you need server-side asynchronous confirmation, see the card events in Webhook + WebSocket notifications.

About PIN rules

PIN complexity and length rules (permitted number of digits, whether simple sequences or repeated digits are rejected, and so on) are enforced inside the DCS-hosted guidance page and are transparent to the partner, so you do not need to reimplement the validation in your own system. If the user enters a PIN that breaks the rules, the page tells them straight away and asks for another.

Next steps