Skip to main content
How-to task page: how a partner calls POST /open-api/customer/v1/send-otp to deliver an OTP it generated itself to a user over the DCS SMS or email channel. This endpoint neither generates nor verifies the OTP. Generating and checking the OTP are the partner’s job; DCS only delivers it.

📄 Guide

Whether you already run your own SMS gateway or would rather reuse the DCS delivery channels, this endpoint sends a verification code to the user’s mobile number or email address: you generate the OTP and hand the delivery to us. The endpoint is for Partner-Managed partners and is typically used at the points in your own flows where you need to reach a user by SMS or email.
this endpoint does not generate or verify OTPs. You generate the OTP, keep it and check it yourself; DCS only sends the OTP content out over the channel you specify.

End-to-end flow (who does what)

Endpoint

POST /open-api/customer/v1/send-otp The request headers (authentication and signature) are the same as for every other /open-api/ endpoint: send X-DAPI-API-KEY, X-DAPI-TIMESTAMP, X-DAPI-NONCE and X-DAPI-SIGN, with Content-Type: application/json. See Authentication and signing for the details.

Request body fields

Required combinations per channel:

Plaintext and ciphertext

The recipient fields (mobile / email) and the OTP itself (otp) can each be sent in plaintext or as ciphertext. For data this sensitive we strongly recommend ciphertext:
  • Ciphertext: fill in mobileEncryption / emailEncryption / otpEncryption using AES-GCM, with your SecretKey as the key and the IV passed in encryptionIV. As soon as any ciphertext field is populated, encryptionIV becomes mandatory.
  • Plaintext: fill in mobile / email / otp and send the values as they are.
  • If you supply both the plaintext and the ciphertext of the same item, the ciphertext wins.

Minimum request example (SMS, plaintext)

Minimum request example (EMAIL, ciphertext)

Response example

Common response envelope: every /open-api/ endpoint returns { code, message, messageDetail, data }. code is the business code (SYS_SUCCESS on success), and messageDetail carries human-readable copy (including title/type/action/linkUrl and so on) when there is something to show the end user, otherwise it may be empty. Decide success or failure from code, never from the HTTP status code or the wording of message alone.

Response fields (data)

status=SUCCESS only means that DCS handed the OTP to the downstream SMS or email gateway successfully; it is no guarantee that the user will receive it (the carrier or the mailbox provider may still get in the way). When status=FAILED, the response code tells you why the downstream delivery failed.

Rate limits

To keep the SMS and email channels from being abused, DCS rate-limits sends to the same recipient under the same Enterprise: Exceeding the limit returns OTP_SEND_TOO_FREQUENT. Ask the user to try again shortly rather than resending immediately.

Idempotency

otpSendRef is your own business idempotency key, and the same otpSendRef cannot be sent twice:
  • First request: the OTP goes out and that otpSendRef is recorded.
  • Repeat request (same otpSendRef): returns OTP_SEND_REF_NOT_UNIQUE.
Make sure every send uses a unique otpSendRef (deriving it from your business reference plus a timestamp works well).

Common error codes

For the full set of business and error codes, see Authorization declines and error codes.

Prerequisites

  • You hold the Enterprise ApiKey / SecretKey and have completed the signing and whitelist setup (see First steps and Authentication and signing).
  • If you send ciphertext, your system needs AES-GCM support, with the Enterprise SecretKey as the key.

Next steps

Once OTP delivery works end to end, carry on with creating a user and the KYC and card issuance flows that follow.