Skip to main content

📄 Guide

Under the DeCard-Managed model, the user comes before the card: an end user must register first to obtain an externalUserId, which then identifies that user across every subsequent endpoint — KYC, card issuance, top-ups, spending, balance queries, and so on. As a licensed issuer with its own BINs, DCS creates a dedicated account for each cardholder, and registration is completed with a phone number or email address plus a one-time passcode (OTP). Registration is a two-step flow: request the verification code, then register with it.
Customer sign-up and OTP verification flowCustomer sign-up and OTP verification flow
behavioral=REGISTER marks this code request as a registration scenario (see step 1 for the field description). DCS creates a dedicated account for each cardholder, with its own available and frozen balances. For account status and asset management, see Managing Users; this is the entry point to the DeCard-Managed, dedicated-account model.

Prerequisites

  • Your Enterprise account is active and you hold your ApiKey / SecretKey. If you do not have them yet, see First Steps and the authentication guide.
  • Every request must carry the signature headers described in the authentication guide. The examples on this page omit those headers and show business fields only.

Step 1 · Send the verification code

Call one of the two code-sending endpoints, depending on the registration method. For both endpoints the only required field is behavioral, and for registration it is always REGISTER.

Sending an SMS code

Sending an email code

A successful response from a code-sending endpoint (the envelope is the site-wide {code, message, messageDetail, data}, with no success boolean; the success code is code = SYS_SUCCESS):
messageDetail is a display-oriented structure (message/title/type/icon/action/linkTitle/linkUrl) and is usually null. The envelope is documented in full in the authentication guide.

Step 2 · Register the user

Call the registration endpoint with the verification code received in step 1. Note that the register endpoint does not take behavioral — that field belongs to the code-sending endpoints only, so do not mix them.
Registering with a phone number:
Registering with an email address:
Either/or rule: phone registration uses mobileCode + mobile + smsCode; email registration uses email + emailCode. Send either smsCode or emailCode, matching the registration method you chose.
The data field of a successful response is the externalUserId generated by the system, which identifies the user in every subsequent endpoint:

Encrypting the phone number or email address (optional)

The mobile and email fields can be sent AES-encrypted or in plaintext; choose whichever suits your integration. To send them encrypted:
  1. Encrypt the plaintext phone number or email address with AES (symmetric encryption) to get the encrypted byte array.
  2. Base64-encode the result into a string.
  3. Put that Base64 string in the mobile or email field of the request.
Here is a Java example (the key is a placeholder; replace it with the key you agreed with DCS):
The phone number, email address and key in the example are placeholders or masked values. Never put real end-user PII or real keys into requests or logs.

Error handling and resends

  • Judging success: use code == SYS_SUCCESS in the response envelope to decide whether the request was accepted; for any other value, read message and messageDetail to find out why.
  • Typical error response: on failure, code carries the specific business error code for that failure (there is no generic failure code), and the specific reason appears in message. When the verification code has expired or was entered incorrectly, the response looks roughly like this (the envelope is unchanged):
    The code and message above are illustrative placeholders; the actual values returned by the endpoint take precedence. The envelope is always {code, message, messageDetail, data}, with the error text in message.
  • Expired or mistyped code: verification codes are time-limited, and an expired or wrong code makes register fail. Call the matching code-sending endpoint again (behavioral=REGISTER) for a fresh code, then retry.
  • Consistent method: the registration method must match the way the code was sent. A code sent by SMS can only be used for phone registration (smsCode), and the same applies to email (emailCode).
  • Idempotency: registering the same phone number or email address twice fails. If you are unsure whether a user already exists, query their status from Managing Users.

Next steps

  • Once registration returns an externalUserId, the usual next step is completing KYC for that user; see Compliance · Overview.
  • To manage account status and review a user’s assets, see Managing Users.
  • To walk the shortest path from registration to card issuance, funding and spending in one pass, see Quickstart.