Request OTP
Verify a customer action with an SMS one-time password
Sends the customer an SMS with a one-time password, then confirms the action using that OTP. The OTP type (otpTypeId) determines what’s being verified and which parameters the SMS template fills in — for example, otpTypeId: 1 is Purchase Authorization, confirming a purchase with its amount, tenor, and installment details.
Flow
Request OTP
Call POST /api/OtpRequests/RequestOtp with the otpTypeId and any parameters for that type. VLens sends the SMS and returns a phoneNumberOtpRequestId.
Step 1 — Request OTP
POST /api/OtpRequests/RequestOtp
cURL
Keep the phoneNumberOtpRequestId — you send it back in step 3.
Step 2 — Confirm OTP
POST /api/OtpRequests/ConfirmOtp
cURL
A successful confirmation returns no error_code:
The full shape of a successful data response hasn’t been confirmed yet — only that error_code is absent on success. This page will be updated once that’s available.
SMS template
Each OTP type has its own template, configured per-tenant from the portal:
Administration → Settings → Messages Management
Every template must include {OTP}. Other placeholders depend on the OTP type and are filled from the parameters you send in step 1.
Example: Purchase Authorization (otpTypeId: 1)
Portal entry: Purchase Authorization OTP SMS — the template must include {OTP} and {AMOUNT}.
Example template (Arabic):
عزيزي العميل، لقد استقبلنا طلبك لعملية شراء بقيمة {Amount} جنيه ومدة التمويل {Tenor} شهر بقسط شهري {Installment_Amount} جنيه. لتأكيد عملية الشراء برجاء استخدام كود: {OTP}
Which parameters keys are supported for otpTypeId values other than 1 hasn’t been confirmed yet.
Portal: OTP Requests screen
A dedicated OTP Requests screen in the portal lets users view and track sent OTPs. Access requires the OTP Requests permission.

