📄 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 setContent-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
customerId, which every later step needs:
2. Apply for a KYC ticket
Upload the identity documents first: callPOST /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 returnedobjectKeyand pass it asidentityProofUrlbelow. For the full sequence, see Apply for KYC, “Option 2, step 1”.
kycTicketId:
Wait for the ticket to reachPASSED: take the result from theKYC_TICKETwebhook or from the query endpoint. If the status isNEED_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 isPASSED, apply for the card with kycTicketId plus customerId:
The response returnscardOrderId. For any further card the same customer applies for, just reuse the samekycTicketId, there is no need to resubmit KYC.
4. Query the card order and wait for issuing to succeed
status = COMPLETED; the response then carries cardId:
Card order state line:PENDING → CUSTOMER_PASS → KYC_PASS → CHANNEL_CUSTOMER_PASS → COMPLETED. OnFAILED, checkerrorCode/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
- The full card issuing flow and KYC details → Card issuing
- Freeze, unfreeze, replace a card, reset the PIN → Card management
- Understand how money moves → Fund model

