Skip to main content

Test Phone Numbers for SMS OTP in the Didit Sandbox

In a Didit sandbox application the phone provider is mocked, so no SMS is sent and nothing is billed; sandbox testing is free and unlimited.

Test Phone Numbers for SMS OTP in the Didit Sandbox

Contents

In this guide

Jump to the part you need.

Testing SMS OTP without texting real people is a sandbox problem. This guide is for developers who need a working phone verification flow with no carrier traffic and no spend. In the Didit sandbox the phone provider is mocked, so no SMS leaves and nothing is billed. Live codes cost the carrier price for the country plus our $0.02 fee. The caveat: sandbox OTP values come from GET /v1/sandbox/scenarios/, while reserved test numbers are documented in the Phone Verification reference, so read both rather than hardcoding values.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Sandbox and live phone verification side by side
WhatSandbox applicationLive application
API key prefixsk_test_sk_live_
SMS deliveryProvider mocked, no message sentReal code over SMS, WhatsApp, Telegram, voice or Viber
Cost per code$0.00, never billedCarrier price for the country and channel plus the $0.02 Didit fee
Where the code comes fromThe sandbox catalog, GET /v1/sandbox/scenarios/The user's phone
Code windowSet by the scenario you run5 minutes from the first send, a same-window retry keeps the deadline
Wrong code limitSet by the scenario you runverification.max_attempts, 5 by default
QuotaSandbox testing is free and unlimited.Plan credit, then top-ups
Webhooks"environment": "sandbox""environment": "live"

Start free in the sandbox at business.didit.me, no sales call. Developers who want an AI assistant to wire the calls can connect Didit through the MCP server. The phone documentation lives at Phone Verification and the per code pricing at phone pricing, with the full price list on pricing.

The outcome, and the method we recommend

You want four things from a test run: a code that verifiably passes, a code that verifiably fails, the risk signals on the number, and the record of all of it in the console. You should get those without a single carrier call.

We recommend the sandbox application as your default test target, with the standalone phone pair for logic tests and the risk endpoint for number quality tests. These four routes each test a different part of the flow:

Phone verification flow diagram: number collection, OTP delivery, code check and risk signals
The flow you rehearse in the sandbox: collect the number, send a code, check the code, read carrier and risk signals. In a sandbox application the provider is mocked at the send step.
  • Sandbox session workflow. Put the PHONE feature in a workflow, create a session, and walk the hosted flow. Every external provider including phone is mocked, so the user experience is real but no message is sent.
  • Sandbox standalone pair. Call POST /v3/phone/send/ then POST /v3/phone/check/ with a sk_test_ key. This is the closest test to the server side of your production integration.
  • Risk scoring without an OTP. POST /v3/phone/risk/ returns carrier, line type, porting and fraud risk for a number without sending anything, in sandbox or live.
  • Reserved test numbers. Network registrations have their own test number endpoints, so you can exercise an approval flow without waiting on a carrier.

Reserved numbers and the way account and number state change a result are documented on the Phone Verification API reference, in the section on number checks, test numbers and account behaviour. Read that page next to the sandbox catalog, because the catalog is generated from the verification service and is the source of truth when a doc looks stale.

Prerequisites

  • A Didit organization. A Free plan organization created with a work email gets $10 of monthly credit, and sandbox testing is free and unlimited. Free plan credit does not cover phone codes, so plan a top-up or a Growth plan before you test live.
  • A sandbox application. Its key starts with sk_test_ and it runs in mode SANDBOX. Keys created before the prefix format have no prefix and still work, so never validate a key by its prefix.
  • The key kept server side. Send it as the x-api-key header on https://verification.didit.me. Never ship it to a browser or a mobile bundle.
  • Phone numbers in E.164 format, for example +14155552671. Anything else returns HTTP 400 on the send call.
  • curl and, optionally, jq for reading responses.

Step by step: test SMS OTP without sending a real SMS

The flow you are testing: collect the number, send a code, check the code and read back carrier and risk signals.

  1. Pick the sandbox application. In the Business Console, select the application whose mode is sandbox and open Developers, then API keys. Every product is on in a sandbox application, so the phone endpoints are already reachable. Copy the primary key into an environment variable: export DIDIT_API_KEY=sk_test_....

  2. Read the reserved values before you write a test. The sandbox catalog is served live and authenticated with the same key. It carries the scenario names, the magic values and the sandbox OTP codes that make an outcome deterministic.

    curl -s 'https://verification.didit.me/v1/sandbox/scenarios/' -H "x-api-key: $DIDIT_API_KEY"

    Keep the values it returns inside your test fixtures. Do not paste them into application code, and do not assume the set never changes: the endpoint, not this page, is the source of truth.

  3. Send a code. This is the documented send call. On a sandbox key the provider is mocked, so nothing reaches a network, and a sandbox send is never repriced as a voice code even when the number is a fixed line.

    curl -X POST 'https://verification.didit.me/v3/phone/send/' -H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" -d '{
      "phone_number": "+14155552671",
      "options": {
        "code_size": 6,
        "preferred_channel": "sms",
        "locale": "en-US"
      },
      "vendor_data": "user-1234"
    }'
  4. Check the code. Send the code the catalog gave you for that scenario, plus the verification_id that the send call returned, so the check targets that specific verification.

    curl -X POST 'https://verification.didit.me/v3/phone/check/' -H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" -d '{
      "phone_number": "+14155552671",
      "verification_id": "<verification-id>",
      "code": "<sandbox-code>",
      "voip_number_action": "DECLINE"
    }'
  5. Score a number without an OTP. When you only care about number quality, skip the send. POST /v3/phone/risk/ returns carrier, line type, porting and fraud risk for one number. This call is not a verification and is not listed with verifications. It is billed as its own price-book line, separate from verification codes.

  6. Test a network registration approval. Network registrations are approved per number, so Didit exposes test number endpoints: add a test number, list registrations, track approval, then remove the test number. Use them to walk the approval states without a carrier in the loop.

  7. Read the records back. Verification records list newest first and you can filter by status, channel, phone number, reference, tag or creation time. next and previous are offsets, not URLs, so pass next as offset. Add format=csv to export.

    curl -s 'https://verification.didit.me/v3/phone/verifications/?status=verified&limit=20' -H "x-api-key: $DIDIT_API_KEY"
  8. Rehearse the failures, then go live once. Run the wrong-code, expired-window and blocked-send cases in the sandbox until your UI handles each one. Then repeat the same pair of calls on the live key with one real number you own, to confirm delivery and the carrier price you will pay.

Expected output

The check step is what returns status plus the carrier, virtual number and disposable number signals. In a sandbox application the carrier leg is mocked, so the shape of the response is the same and nothing is delivered.

The status field is the one you branch on. The risk fields come back with the check response, so the same call answers both questions.

Phone verification flow showing where the check response returns status, carrier and risk data
The check call returns status plus carrier type, virtual number and disposable number signals. In sandbox the shape is the same and nothing is delivered.
What to expect from a phone verification check
FieldValues you will seeWhat it means for your test
statusNot Started, In Progress, Approved, Declined, Failed, Expired or Not Found, Abandoned, Kyc ExpiredApproved is the pass case. Failed means wrong code with attempts left.
carrier.typemobile, landline, voipUse it to route the channel, for example voice for a fixed line.
is_disposabletrue or falseThrowaway number detection. Pair it with disposable_number_action.
is_virtualtrue or falseVoIP or virtual number. Pair it with voip_number_action.
line_type, portedCarrier line type and porting stateUseful when a number changed networks and delivery behaves oddly.
warnings[]DUPLICATED_PHONE_NUMBER, DISPOSABLE_NUMBER, VOIP_NUMBER, INVALID_PHONE_NUMBER, OTP_DELIVERY_FAILED, OTP_MAX_ATTEMPTS_REACHED, OTP_EXPIRED, PHONE_NUMBER_BLOCKEDEach warning is a branch in your UI or your risk rules.

Failure cases and how to recover

  • HTTP 400 on send. The number is not E.164. Normalise it to a leading plus and country code before you retry.
  • status="Blocked" with reason spam. The abuse protection refused the send. No code was sent and nothing was charged. Do not retry in a tight loop, and do not treat it as a delivery failure.
  • status="Failed". Wrong code with attempts remaining. Re-prompt the user and show the remaining attempts. The default limit is 5 wrong entries per standalone verification.
  • status="Declined". The verification ended. If the OTP_MAX_ATTEMPTS_REACHED warning is present, the user exhausted the configured limit. Start a new verification rather than reusing the record.
  • status="Expired or Not Found". You are outside the 5-minute window, or there is no pending verification for that number. Restart the send. A same-window retry keeps the original deadline.
  • HTTP 401 or 403. A wrong or missing key returns 401 and 403 respectively. A scoped key without access to the resource also returns 403. Re-issue or re-scope the key in the console.
  • HTTP 429. Rate limited. The response carries a wait field in seconds. Back off by that amount.

Inputs and outputs

Fields you send and fields you read back
DirectionFieldNotes
Inphone_numberE.164. Required on send and on check.
Inoptions.code_sizeCode length. Six is the documented example.
Inoptions.preferred_channelsms, whatsapp, telegram, voice, viber. Falls back to SMS when the channel is unavailable.
Inoptions.locale, options.sms_sender_nameMessage locale, and a sender name of 1 to 30 characters for one code.
Invendor_dataYour own reference, echoed on the record.
Inverification_idFrom the send response, so the check targets that verification.
Incode, voip_number_actionThe typed code, and what to do when the number is VoIP, for example DECLINE.
OutstatusThe decision for the verification.
Outcarrier, line_type, is_disposable, is_virtual, portedThe number quality signals.
Outwarnings[]The risk catalogue for the phone feature.
Outverification_idUse it for the check, the record lookup and support.

What is billed, and where review starts

  • Sandbox: Sandbox testing is free and unlimited. A sandbox application is never billed and the balance check is bypassed.
  • Live codes: the carrier price for the country and channel plus our $0.02 fee. On Growth the fee is $0.0192 and on Scale $0.018. Carrier charges pass through at cost; only our fee takes the plan discount. You pay when a check finishes with a result, so a blocked send is free.
  • Risk lookups: risk lookups are their own price-book line, separate from verification codes. Lookups skip the first-top-up requirement but still need credit to cover them.
  • Free plan boundary: phone codes are excluded from Free plan credit. Sending codes requires a paid Growth or Scale plan or the organization's first top-up.
  • Review boundary: there is no manual review inside OTP verification. The review step in this flow is the network registration approval, which is tracked per number through the registration status endpoint, and the sandbox test number endpoints let you walk that approval without a carrier.

Worked cost example

Take 500 US phone verifications in one month, all by SMS, at list price. Prices are per country and channel, and carrier charges pass through at cost. One US SMS code is $0.0473 total: the carrier price plus the $0.02 fee. 500 x $0.0473 = $23.65. Run the same 500 in the sandbox and the arithmetic is 500 x $0.00 = $0.00, which is the reason test traffic belongs there.

Mix the channels and the number moves. 300 by SMS and 200 by WhatsApp: 300 x $0.0473 = $14.19, 200 x $0.0431 = $8.62, total $22.81. Telegram is $0.05 per code in every country in the feed, so 500 Telegram codes would be 500 x $0.05 = $25.00.

On a discount plan only our fee shrinks. The US carrier part is $0.0473 minus $0.02 = $0.0273. On Growth that gives $0.0273 + $0.0192 = $0.0465 per code, so 500 x $0.0465 = $23.25. On Scale it is $0.0273 + $0.018 = $0.0453, so 500 x $0.0453 = $22.65. All of it is $0 in a sandbox application.

Sources

Open a sandbox application at business.didit.me, copy the sk_test_ key, and run the send and check pair against your own test fixture before you spend anything on live codes. No sales call.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

How do I test SMS OTP without sending a real text?

Create a sandbox application in the Didit Business Console and use its sk_test_ key on POST /v3/phone/send/ and POST /v3/phone/check/. In sandbox every external provider, phone included, is mocked, so no SMS is sent to anyone and no third party is called. You read the sandbox code from GET /v1/sandbox/scenarios/ and check it like a real one.

Do sandbox phone verifications cost anything?

No. Sandbox testing is free and unlimited, and sandbox sessions are never billed. Live codes cost the carrier price for the country plus the $0.02 Didit fee.

What test phone numbers does Didit provide?

Reserved test numbers, and how account and number state change a result, are documented in the Phone Verification API reference, and sandbox OTP values come from GET /v1/sandbox/scenarios/. Network registrations have their own test number endpoints to add a test number, list registrations, track approval and remove it, so you can walk the approval states without a carrier. Read both live sources instead of copying a number from a blog post.

How long is an OTP valid and how many attempts do I get?

A live code is valid for 5 minutes from the first send, and a retry inside that window keeps the same deadline. The wrong code limit is the verification.max_attempts setting, 5 by default for a standalone verification. In sandbox both values follow the scenario you run.

Can I test phone verification without sending any code at all?

Yes. POST /v3/phone/risk/ scores carrier, line type, porting and fraud risk for a number without an OTP. Use it when you only need number quality, for example to block disposable numbers at signup. It is billed as its own price-book line, separate from verification codes, and in sandbox it is mocked like everything else.

Why does my check call return Expired or Not Found?

Either you are past the code window, or there is no pending verification for that number. Restart with a new send and pass the new verification_id to the check. If you are testing in a loop, confirm you are reusing the same number and the newest verification, not an older one.

What does a Declined status mean on a phone verification?

Declined means the verification ended, not that the code was merely wrong. If the OTP_MAX_ATTEMPTS_REACHED warning is present, the user used up the configured attempts. Start a fresh verification instead of retrying the declined record.

Can I use my own phone number in the sandbox?

In a sandbox application the phone provider is mocked, so a number in E.164 format can be used to rehearse the UI and nothing is delivered. The scenario supplies the expected sandbox code, and the digits you type do not decide the outcome: an incorrect code still exercises the failure path. Read the catalog for the reserved values, and use a number you control on a live key, where the code is a real message and the carrier price applies.

How do I test WhatsApp, Telegram or voice instead of SMS?

Set options.preferred_channel to whatsapp, telegram, voice or viber on the send call. Delivery falls back to SMS when the preferred channel is unavailable, and an eligible new SMS send to a fixed line may be read out in a call instead and priced as a voice code. That fallback never applies to a sandbox send.

Where do I see phone verification records and risk lookups?

Verifications are listed at GET /v3/phone/verifications/, filterable by status, channel, number, reference, tag and creation time, with a CSV export. Risk lookups are not verifications and are read separately at GET /v3/phone/lookups/. Each verification record includes every attempt.

Is a Didit sandbox application enough to go live later?

The calls and fields are the same, so a working sandbox integration is most of the work. What changes is the key prefix, real delivery, and billing: live codes need plan credit or a top-up, and phone codes are excluded from Free plan credit. Repeat the send and check pair once on the live key with a number you own before you release.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.