Last modified:2026-11-19 19:46:24
x-auth:Public
x-called-from:after the customer picked a product and entered a phone. Must run **before** verify.
x-details:body `{ phone, product_id, consent }`. `consent` must be `true`; it is stored against the hashed phone before the code is sent. Success `data.message` is `OTP has been sent to 9876543210 successfully` (10-digit number, no country code). The code is never in JSON. Mock: use collection `otpCode` (server `MOCK_OTP_CODE`, default `123456`). Missing or false consent → `422 validation_failed`. Too many requests → `429 rate_limited`.
x-errors:[{"meaning":"invalid_phone: That phone number doesn't look valid. Please check and try again.","status":422},{"meaning":"invalid_product: This loan product isn't available. Please choose a product from the list and try again.","status":422},{"meaning":"phone_required: A phone number is required.","status":422},{"meaning":"product_id_required: A product_id is required. Choose a product from the list first.","status":422},{"meaning":"validation_failed: Consent is required.","status":422},{"meaning":"rate_limited: Too many OTP requests. Try again later.","status":429}]
x-next:`POST /auth/otp/verify` with the same phone, the same `product_id`, and the code. If the SMS didn't arrive, `POST /auth/otp/resend` (same body, same rate limit).
x-order:0
x-section:otp
x-when:body `{ phone, product_id, consent }`.