Going live

Production checklist

What to check before switching from a test key to a live key.

Copy this list into your pull request or ticket.

Keys and configuration

  • The live key is in the production environment only (OTP_PS_API_KEY), marked secret, not in Git.
  • No key, verification id, code or test_code reaches the browser or app (check the network tab).
  • Development and CI use a test key.
  • The account is approved and has credit (GET /api/v1/balance answers status: "active").
  • Each key has only the permissions it needs (e.g. no read on the website's key, read only for reporting).
  • A daily (and monthly) spending limit is set a little above your busiest real day.

Flow

  • The right code verifies; your server records the number it sent the code to.
  • The saved order or account phone is compared with the verified number.
  • Wrong code shows the tries left; after 5 the customer is asked for a new code.
  • Expired codes ask for a new one (sandbox number 0599000005).
  • Resend has a 30-second countdown and respects retry_after.
  • Double-clicking "Send" sends one message; retries use an Idempotency-Key.

Errors

  • invalid_phone and unsupported_network show a clear message in the customer's language.
  • sms_failed (0599000002) lets the customer retry.
  • insufficient_balance (0599000003), spending_limit_reached, insufficient_scope, unauthorized, account_pending and account_suspended alert your team.
  • Network failures and timeouts show a friendly message, and you've decided what happens to the order or sign-up then.

Abuse

  • Your send endpoint has a per-IP / per-session limit.
  • Public forms have a CAPTCHA or similar.
  • Someone watches the balance (low-balance warning on the dashboard) and the activity log.

Language and layout

  • Arabic pages are right to left; number and code inputs are dir="ltr".
  • locale matches the customer's language.
  • The code input has autocomplete="one-time-code" and a numeric keyboard.

Finally

  • One real send to your own Jawwal and Ooredoo numbers with the live key.

View as Markdown