On this page
OTP verification works by sending a short, temporary code to a user’s phone and asking them to type it back into your app. If the code matches and has not expired, your app knows that the person really controls that phone number. In Iraq the code usually arrives on WhatsApp, with SMS or Telegram as a backup when WhatsApp is not available.
This guide walks through the full OTP lifecycle, compares the three delivery channels for users in Baghdad, Erbil and the rest of Iraq, and lists the security and design rules that separate a reliable verification flow from one that leaks money or users.
What is an OTP, and how does it relate to 2FA?
A one-time password (OTP) is a code, usually 4 to 6 digits, that is valid for a single use and a limited time. Because it changes every time, a stolen or reused code is worthless once it has been used or has expired.
Apps use OTPs in two main ways:
- Phone verification: confirming that a new user owns the number they entered at sign-up, or logging them in without a password.
- Two-factor authentication (2FA): adding a second check on top of a password. The password is something the user knows; the phone that receives the code is something the user has. An attacker needs both.
Banks and fintech apps also send OTPs to confirm sensitive actions, such as a transfer, a new device or a password reset. Delivery, taxi and e-commerce apps mostly use them to verify phone numbers, because the phone number is the customer’s account.
The OTP lifecycle in 5 steps
Whatever channel you use, every verification follows the same path:
- The user enters a phone numberYour app checks the format (for Iraq, a 07xx mobile number in international form, such as 9647701234567) and asks your server to start verification.
- Your server calls the send endpointThe request goes from your backend, never from the app itself, to the OTP API with the number, the channel and the language.
- A code is generated and deliveredThe provider creates a random code, stores it with an expiry time and sends it by WhatsApp, Telegram or SMS. If the first channel fails, a fallback channel takes over.
- The user types the codeThe message usually arrives quickly. The user copies or types the digits into your verification screen.
- Your server calls the verify endpointThe code is checked against the stored one. If it matches and is still valid, the number is marked as verified and the code can no longer be used.
The important detail is in steps 2 and 5: both happen on your server. The app only collects the number and the code; it never decides on its own whether a code is correct.
SMS vs WhatsApp vs Telegram verification in Iraq
The channel affects cost, reach and how quickly users finish sign-up. Here is how the three compare for phone verification in Iraq and the Kurdistan Region (Startup plan prices per code):
| Channel | Reach | Price per code | Needs internet | Typical use |
|---|---|---|---|---|
| Around 9 in 10 Iraqi users | $0.01 (17 IQD) | Yes | First attempt for sign-up and login | |
| Telegram | Users with a Telegram account | $0.01 (17 IQD) | Yes | Low-cost fallback |
| SMS | Every mobile phone on Zain, Asiacell and Korek | $0.09 (150 IQD) Asiacell/Korek, $0.22 (365 IQD) Zain | No | Fallback, users without data, older phones |
On the Standard plan, WhatsApp and Telegram codes cost $0.02 (33 IQD) and SMS costs $0.10 for Asiacell and Korek or $0.24 for Zain. There is no setup or monthly fee; you top up your balance and pay per message. Full details are on our pricing page.
Why WhatsApp first, SMS second
WhatsApp codes are cheaper and arrive in an app most Iraqis already open many times a day. SMS is the safety net: it reaches every number, even when the user has no data or no WhatsApp account. Combining the two gives you the low price of WhatsApp with the reach of SMS. A failed WhatsApp attempt is never charged, so a code that falls back to SMS costs only the SMS price.
For comparison, global providers list SMS OTP to Iraq at around $0.30 to $0.55 per message (Twilio $0.503, AWS $0.30566, checked 27 November 2026), which is why local routing and WhatsApp-first delivery matter for apps with many users.
How Bulk SMS Iraq handles OTP verification
Our OTP API covers the whole lifecycle with two calls. You send the number and settings; we generate the code, deliver it and check it for you.
Send a code with POST https://gateway.standingtech.com/api/v5/otp/send and a Bearer API key:
{
"recipient": "9647701234567",
"sender_id": "YourApp",
"channel": "whatsapp",
"fallback": "sms",
"message": "auto",
"lang": "ku"
}
With "message": "auto" we generate the code; you can also pass your own. lang sets the message language: en, ar, ku or fa. fallback can be sms, telegram or none and applies when the channel is WhatsApp. The response returns an id; store it with the user’s session.
Verify the code with POST /v5/otp/verify:
{ "id": "6745f1c2a9e3b", "code": "482915" }
WhatsApp codes arrive from a verified business sender, not from an unknown number. If you want your brand name on every code, we connect your own WhatsApp Business Account to the same API. On SMS, codes go out under your registered sender ID. All parameters and error codes are in the API documentation.
OTP security checklist
An OTP flow is only as strong as its weakest rule. These are the OTP security best practices we recommend to every customer:
- Short validity. Our codes expire after 30 minutes. Never accept a code after it has expired.
- Limited attempts. A code is locked after 5 wrong attempts, which stops attackers from guessing their way in.
- Single use. Once a code has been verified, treat it as spent. A second login needs a new code.
- Rate limits per number. The API allows 2 OTPs per number per 30 seconds, plus hourly and daily caps. Add your own limits per IP address and per device as well.
- Protection from SMS pumping. Bots can request thousands of codes to premium or fake numbers and leave you with the bill. Our OTP Firewall blocks this traffic before it is sent.
- Verify on the server. Send and verify from your backend only. Never put your API key in a mobile app or website code.
- Never log codes. Keep OTPs out of application logs, analytics events and support tools.
- Don’t reveal whether an account exists. Show the same message, such as “If this number is registered, we have sent a code”, whether or not the number is in your database.
UX mistakes that hurt conversion
A secure flow that frustrates users still costs you sign-ups. These are the problems we see most often:
Also tell users where the code will arrive (“We sent a code to your WhatsApp”), and let them edit the number if they typed it wrong. Both reduce support requests more than any technical change.
Building phone verification for your app? Our team in Erbil can help you set up WhatsApp OTP with SMS fallback.
Contact usFrequently asked questions
What does OTP stand for?
OTP stands for one-time password: a short numeric code, usually 4 to 6 digits, that is valid for one login or action and expires after a set time. It proves that the user has access to the phone number or account it was sent to.
Is OTP the same as two-factor authentication (2FA)?
Not exactly. 2FA means checking two different factors, such as a password and a phone. An OTP is one common way to deliver the second factor, but apps also use OTP alone for passwordless sign-up and login.
Which is better for OTP in Iraq: SMS or WhatsApp?
For most apps, WhatsApp first with automatic SMS fallback. WhatsApp is cheaper and typically reaches around 9 in 10 Iraqi users, while SMS works on every phone on Zain, Asiacell and Korek, even without internet.
How long is an OTP code valid?
With the Bulk SMS Iraq API, a code stays valid for 30 minutes and is locked after 5 wrong attempts. In your app you can show a shorter countdown before allowing the user to request a new code.
What happens if the user does not receive the code on WhatsApp?
If you set a fallback, the API sends the code again by SMS or Telegram automatically. A failed WhatsApp attempt is never charged, so you pay only for the message that was delivered.



