English
Tunisia (+216) SMS Verification: A Checklist for Developers
Yes, you can receive Tunisia (+216) verification codes with OTP Route: order a number on the OTP Gateway and read the code in the dashboard, poll the REST API, or take it from a signed webhook. Prices start from $0.20 per code, and an order that gets no SMS within 20 minutes is refunded to your wallet automatically.
What belongs on the pre-flight checklist before ordering a +216 number?
Run through this list once and most Tunisia test runs go smoothly:
- API key ready. Create a Bearer key in the Developer console; live keys start with
or_live_. - Wallet funded. The OTP Gateway draws from your prepaid USD balance;
GET /api/v1/balanceconfirms it from a script. - Webhook reachable. Register an HTTPS endpoint, store its secret, and confirm your server clock is accurate so timestamp checks pass.
- Price checked. Call
GET /api/v1/prices?country=tn&service=<id>for the exact service you plan to test. - Phone field tested. Make sure your own form accepts an eight-digit Tunisian national number and a pasted
+216international one. - Parser tolerant. Confirm code extraction works for Arabic, French and English message bodies (see below).
- Terms reviewed. You are testing your own product or operating your own legitimate account, in line with the service's rules and OTP Route's Acceptable Use Policy.
How are Tunisian numbers formatted for E.164?
Tunisia uses a closed numbering plan: every subscriber number is eight digits and there is no trunk prefix, so nothing has to be stripped before adding the country code. The E.164 form is simply +216 followed by those eight digits. Locals often write numbers in groups such as xx xxx xxx, so remove spaces, dots and dashes when normalising. Avoid validating against a fixed list of leading digits; the length check plus a reputable phone library is safer than a hand-written range table.
Which languages do Tunisian verification texts arrive in?
Arabic is the official language, Tunisian Arabic is what people speak day to day, and French is common in business, administration and many apps. As a result a single test run can see codes in French, English or Arabic depending on the sender and the device locale.
Arabic messages travel as Unicode SMS and may contain right-to-left direction marks around the digits. A regex that grabs the first run of four to eight ASCII digits, after stripping invisible marks, survives all three languages. Teams usually add Tunisia to their matrix for francophone North African launches alongside Morocco and Algeria, for localisation QA of right-to-left layouts, or because they serve Tunisian customers living in Europe; a +216 number for testing covers each of those cases.
Step by step: receiving a Tunisia OTP through the API
The live snapshot lists more than 1,700 services for Tunisia, including Facebook, WhatsApp, Instagram, Telegram, TikTok, Google (Gmail & YouTube), Snapchat, Signal, LinkedIn, Discord, ChatGPT (OpenAI), Microsoft & Outlook, Amazon and Uber. Availability changes during the day, so let your OTP routing logic read it from GET /api/v1/services and GET /api/v1/countries when a run starts.
- Send
POST /api/v1/activationswith{"service": "facebook", "country": "tn"}and save the activation id. - Type the returned number into the app you are testing and trigger the code.
- Handle
activation.sms_receivedon your webhook: verifyX-OTPRoute-Signature(HMAC-SHA256 of the timestamp, a dot and the raw body), reject old timestamps, and ignore duplicates for an activation id you already processed. - Without a webhook, poll
GET /api/v1/activations/{id}, keeping well under the 300 requests per minute limit. - Call
POST /api/v1/activations/{id}/cancelif the test is aborted.
The API docs list every field, and the CI testing guide shows how to wire this into a pipeline.
Step by step from the dashboard
- Create an account with your email and a six-digit code, or with Google sign-in, and turn on TOTP two-factor.
- Add funds by card or USDT/USDC.
- Choose Tunisia, then the service, and check the displayed price.
- Order, copy the +216 number, and request the code in the target app.
- Copy the Tunisian code from the dashboard as soon as it shows up and finish the sign-up you are testing.
Troubleshooting: what if the +216 code never shows up?
Each activation runs for 20 minutes, and you pay only when a code arrives. If the window lapses or you cancel, the full amount returns to the wallet.
- Nothing arrived at all: let the window run out, then retry later or with another service route if the test allows.
- The service refused the number: some services reject virtual numbers; the refund covers that case.
- Webhook silent but dashboard shows the code: your signature check is probably failing; compare against the raw body, not re-serialised JSON, and check clock drift.
- Several failures in a row: add a back-off; reordering in a tight loop rarely helps.
Long-term lines, billing and sandbox for Tunisia
There is no self-serve long-term Tunisian number. Dedicated Numbers are a US and Canada product from $1.95/month; if you need a lasting +216 line, email [email protected], bearing in mind that availability depends on local rules.
The wallet is pay as you go with no monthly fee, and every top-up gets a PDF invoice by email. Development accounts can request sandbox mode, where simulated numbers and codes let you prove the integration without spending balance.
Frequently asked questions
Can I test a Tunisian sign-up flow without a Tunisian SIM?
Yes. Use a +216 number from the OTP Gateway and collect the code in the dashboard or through the SMS verification API and webhooks.
Do Tunisian numbers have a trunk prefix to remove?
No. Tunisian numbers are eight digits with no trunk prefix, so the E.164 form is just +216 plus those digits.
What is the Tunisia OTP API country id?
Use tn in the prices query and in the POST /api/v1/activations request body.
How much does a Tunisia verification number cost?
From $0.20 per code; the exact amount depends on the service and appears in the dashboard and the prices endpoint before you order. See pricing.
My parser fails on Arabic OTP messages. What should I change?
Strip Unicode direction marks and match the digit sequence instead of surrounding words, so the same rule works for Arabic, French and English bodies.
Can I keep a +216 number for later logins?
Not through self-serve. A gateway number covers a single code, and instantly available long-term lines exist only in the US and Canada.
Service names are trademarks of their respective owners. OTP Route is not affiliated with them. Use numbers lawfully, follow each service's terms and our Acceptable Use Policy.