Skip to main content

📄 Guide

This guide gets the core endpoints working in the sandbox and issues your first virtual card, in five steps. Sandbox base URL: https://api.thedecard-sandbox.com
The examples below leave out authentication headers and field encryption. Every request must carry the four authentication headers (X-DAPI-API-KEY / X-DAPI-TIMESTAMP / X-DAPI-NONCE / X-DAPI-SIGN) and set Content-Type: application/json, and sensitive fields such as phone number, email and KYC data must be AES encrypted. For the rules, see Authentication.
Why the step-by-step path (create customer, apply for KYC, apply for card):
  • The KYC ticket is reusable: when the same customer applies for a second card there is no need to resubmit documents, simply reuse the same kycTicketId.
  • Clearer states, easier troubleshooting: KYC and card issuing are decoupled, each with its own ticket and its own state line.

1. Create the customer

The response returns customerId, which every later step needs:

2. Apply for a KYC ticket

Upload the identity documents first: call POST /open-api/intent-ticket/v1/generate-pre-upload-url (businessType=CREATE_CARD_KYC) to get a temporary upload URL, PUT the file, then take the returned objectKey and pass it as identityProofUrl below. For the full sequence, see Apply for KYC, “Option 2, step 1”.
The response returns kycTicketId:
Wait for the ticket to reach PASSED: take the result from the KYC_TICKET webhook or from the query endpoint. If the status is NEED_VERIFY, guide the customer through liveness verification. For document fields, the state machine and rejection codes, see How-to · Apply for KYC; for eligible regions and the document requirements of each region, see Compliance and KYC.

3. Apply for the virtual card (NORMAL mode)

Once the KYC ticket is PASSED, apply for the card with kycTicketId plus customerId:
The response returns cardOrderId. For any further card the same customer applies for, just reuse the same kycTicketId, there is no need to resubmit KYC.

4. Query the card order and wait for issuing to succeed

Poll until status = COMPLETED; the response then carries cardId:
Card order state line: PENDING → CUSTOMER_PASS → KYC_PASS → CHANNEL_CUSTOMER_PASS → COMPLETED. On FAILED, check errorCode / errorReason (see Card application error codes).

5. Query the card details, the card is ready to spend

Virtual cards are activated automatically (physical cards must be activated). The full card number and CVV are only available through a dedicated endpoint, see Retrieving card sensitive data. Your first virtual card is now active. When the cardholder spends, DCS forwards the authorization request to your auth_url and you return Approve or Decline in real time. This is the heart of the Partner-Managed model, see Authorization (forwarded decisions).

Next steps