Skip to navigation

Request OTP

View as Markdown

Sends the customer an SMS with a one-time password to verify an action (e.g. otpTypeId: 1 for a purchase). Each OTP type has its own template, configured per-tenant from the portal (Administration → Settings → Messages Management) — every template must include {OTP}.

Authentication

ApiKeystring
Static API key issued to your tenant. Required on every request.
OR
AuthorizationBearer

End-user JWT from registration or login. Required for verification, signing, and user-scoped operations.

Request

This endpoint expects an object.
otpTypeIdintegerRequired

The OTP type. 1 = Purchase Authorization. To complete in the docs: full list of supported otpTypeId values.

transactionIdstringRequired

Caller-supplied identifier for this request. Echoed back in step 2.

phoneNumberstringRequired
The phone number to send the SMS and OTP to.
langstringOptional

Language of the SMS template, e.g. ar or en.

parametersobjectOptional

Values substituted into the configured SMS template. For otpTypeId: 1, supports amount, tenor, installment_amount — these fill the {Amount}, {Tenor}, {Installment_Amount} placeholders. To complete in the docs: confirm whether other otpTypeId values support different parameter keys.

Response

OTP sent.
dataobject
error_codeinteger or null
error_messagestring or null
error_descriptionsstring or null