Skip to main content
This page walks you through the shortest path in the sandbox: register a user, issue a first virtual card, fund it, complete a purchase, and query the matching records and statements. The flow has 5 modules and 13 steps, and each step calls one endpoint. In the DeCard-Managed model, sensitive operations such as KYC and viewing card details are completed by the cardholder on a DCS-hosted page; you initiate them through the API and get the results through Webhooks and query endpoints.

Before you start

Before Step 1, make sure these 4 items are ready (see First Steps):
  1. API Key / Secret Key issued.
  2. Egress IP provided to DCS (the API uses an IP allowlist).
  3. Webhook callback URL configured: the results of card issuance, deposits and purchases all arrive by Webhook.
  4. Request signing working: every request carries X-DAPI-API-KEY / X-DAPI-TIMESTAMP / X-DAPI-NONCE / X-DAPI-SIGN; see the Authentication Guide.
The sandbox base URL is https://api.thedecard-sandbox.com (production: https://api.thedecard.com). The examples below omit the authentication headers, and all sample values are masked placeholders. Every response has the shape {code, message, messageDetail, data}, and code = SYS_SUCCESS means success. Each step below lists only the fields you need from data.

📄 Guide

Steps at a glance

Quickstart end-to-end flow (Steps 1–13)Quickstart end-to-end flow (Steps 1–13)

1. Sign-up

Step 1: Send the SMS code

Send a registration code to the cardholder’s mobile number.
Key response: data is an empty string; the code is sent to the cardholder’s phone by SMS. Notes:
  • Set behavioral to REGISTER; a new user has no externalUserId yet, so leave it empty.
  • mobileCode is the country code (ISO 2-letter, such as SG); mobile has no dialing prefix.

Step 2: Register the user

Complete registration with the code the cardholder received.
Key response: data is the externalUserId (for example "4dc3e854-xxxx-xxxx-xxxx-91a98b3d832c"). Every later endpoint identifies the user by it, so store it. Notes:
  • mobileCode, mobile and smsCode must all be provided.
  • You can also register by email (email + emailCode), but not together with a mobile number; see User Sign-up.

2. Card issuance

KYC and card application both happen on the DCS-hosted page; the cardholder’s documents and selfie go straight to DCS and never pass through your backend.
Key response: data is a one-time hosted-page link; have the cardholder open it in a browser. Notes:
  • The link is valid for 5 minutes. Generate it and redirect immediately while the cardholder is online; do not send it asynchronously, for example by email.
  • If the user’s KYC is already PASS or PENDING, the call returns OPERATION_UNSUPPORTED and cannot be repeated.
For language, theme and the other parameters, see H5 KYC / Card Onboarding Guidance Page.

Step 4: Receive the card-application result

Once the cardholder submits on the hosted page, DCS pushes the result to you as the Webhook CARD_APPLY. Key response (inside data): Notes:
  • Return a 2xx within 2 seconds of receiving the Webhook; store it first and process it asynchronously, or it will be treated as a timeout and redelivered.
  • When status = PENDING and needExtraInfo = true, the cardholder must upload extra documents; see below.
If extra documents are needed: get an extra-document link with the same applyId and hand it to the cardholder; once they finish, DCS pushes CARD_APPLY again.

3. Card management

Step 5: Query card detail

Key response: cardStatus (NORMAL / FROZEN / BLOCKED / CANCELLED), cardNo (masked card number), physicalCardStatus (physical card status). Notes:
  • cardId is optional; without it, all of the user’s cards are returned.
  • BLOCKED is an issuer-side block the cardholder cannot lift themselves; the reason is in statusReason. See Managing Cards.

Step 6: Show card details

The full card number, CVV and expiry are never returned to your backend through the API; the cardholder views them directly on the DCS-hosted page.
Key response: data is a one-time hosted-page link for the cardholder to open. Notes: cardId is required.

Step 7: Freeze / unfreeze

Key response: data is a boolean; true means the operation succeeded. Notes: block = true freezes and false unfreezes. Unfreezing also needs smsCode or emailCode; send the code first with the Step 1 endpoint using behavioral = CARD_UNFROZEN. Physical card and PIN (optional): these also use POST /redirect/v2/guidance-link, with the same request body as Step 6 and only action changed. See Issuing Cards and Managing a Card’s PIN.

4. Deposits and simulated purchases

Step 8: Get the deposit address

Key response: address (the deposit address) and status (PENDING being allocated / SUCCESS allocated / FAILED allocation failed). Notes:
  • On first request the address may still be allocating (PENDING); poll until SUCCESS before using it.
  • The sandbox supports only TRON + USDT and Ethereum + USDC; for the chains and tokens supported in production, see Crypto Deposit.

Step 9: Deposit

In the sandbox, a simulator endpoint fakes an on-chain arrival; in production the cardholder transfers on-chain to the address from Step 8.
Key response: data.txHash (the hash of the simulated arrival). Once credited, the Webhook ORDER_STATUS is pushed (transStatus = SUCCESS). Notes: to show the cardholder their balance, use GET /user-asset/v1/balance; see User Balance.

Step 10: Purchase

In the sandbox, a simulator endpoint starts a card authorization; in production it is triggered by the cardholder spending with the card.
Key response: data.approved (whether it was approved). Every purchase pushes the Webhook CARD_TRANSACTION: response = A means approved and D declined, with the decline reason in rejectReason. Notes: authType can also be REFUND (return) or REVERSAL (reversal); see Simulating Transactions.

5. Queries and reconciliation

Step 11: Query deposit records

Key response: for each record, debitCreditIndcator (C credit / D debit), transactionAmount, and transferDetails (on-chain deposit details, including txHash).

Step 12: Query statements

Key response: for each statement, statementId (needed in Step 13) and statementDateStart / statementDateEnd (the billing period).

Step 13: Query statement detail

Key response: for each transaction in the statement, transactionType (R purchase / C cash / P repayment / Q memo), debitCreditIndcator (debit or credit), and postIndicator (1 posted / 0 not posted). For the full fields and pagination rules, see Managing Transactions · Overview. Your first card is now issued, funded and has completed a purchase, and you can query the matching deposit records and statements.

Next steps