The source of truth for this data is
serialize_catalog() in the verification service, served live at GET /v1/sandbox/scenarios/. A drift-tested copy is generated into docs/sandbox/SANDBOX_REFERENCE.md in the service-didit-verification repo via pipenv run python scripts/generate_sandbox_reference.py. This page mirrors that reference — always trust the live catalog endpoint if anything here looks stale.Environment model
Sandbox is a per-application mode (ApplicationDetail.mode == SANDBOX), the same idea as Stripe test mode. While a session runs under a sandbox application:
- Every external provider (OCR, AML, face match, liveness, NFC, phone, email, IP, POA, database validation, document AI) is mocked — no third party is ever called.
- Sessions are never billed and the balance check is bypassed.
- A per-application quota of 500 session creates / 24h is enforced.
- Webhooks carry
"environment": "sandbox"(live sessions carry"environment": "live"). - The hosted flow exposes the session environment so the UI can warn users not to upload real PII.
- Outcomes never depend on the pixels: extracted data and statuses come from the scenario / magic value. The captured media itself (documents, selfie, video, POA files) is stored for real, exactly like a live session.
How to switch between live and sandbox
Live and sandbox are separate applications, so test traffic and production data never mix. Each application has amode of live or sandbox:
- Use a sandbox-mode application’s API key to get mocked, unbilled, simulatable sessions.
- Use a live-mode application’s API key for real verifications.
sandbox_scenario field on session create and the simulate endpoints are only accepted on sandbox applications; they are rejected on live applications.
Sandbox in the hosted verification flow
Sessions created under a sandbox application render extra UI in the hosted verification flow (theurl returned by POST /v3/session/):
- In-card sandbox banner. Every screen shows a banner inside the card - “Test data only - no real calls” - so it is always obvious the session never calls real providers and never touches your balance. Captured media is stored like any session, so use the sample documents and test data rather than real identity documents or personal information.
- Pre-flow scenario picker. Before capture starts, an in-card picker walks the user through choosing a test result: pick an outcome, then a trigger for that outcome. Confirming calls
POST /v3/session/{session_id}/sandbox/arm/(see Arm (or re-arm) the session before the flow starts below), then continues into the flow with that scenario’s magic values already applied. - Sample documents strip. A single row of sandbox sample documents (up to 3) sits directly below the document upload/capture component. Tap one to use it instead of a real upload.
Scenarios
Each scenario is a named bundle of magic values. Pass its slug assandbox_scenario on session create (or to the simulate endpoint) to reproduce the outcome.
review_* scenarios exist so you can test manual-review UX (the console review queue, In Review webhooks, reviewer approve/decline actions) without needing a decline-grade input. The two kyb_* scenarios above set expected_details.registration_number instead of expected_details.first_name: they only apply to Business Verification (KYB) sessions.
Magic values
A magic value is a specific input that makes one mocked feature emit a specific risk. Set the input field to the magic value (directly, or via a scenario) to trigger it.The sample documents
The hosted flow offers three sample documents, one per document type:
Tap a sample in the strip to use it instead of a real capture. The extracted data and the session outcome always come from the selected scenario or magic value, so any sample works with any scenario.
Sample identity: testing expected_details
Every sandbox document is fabricated from one pinned identity.
The extracted values are the same on every session and are never derived from the current date, so you can prefill expected_details with them and check your field-comparison and warning handling end to end.
Pass the values below and the comparison checks pass; pass anything else and the matching *_MISMATCH_WITH_PROVIDED warning fires on purpose.
Dates are shared by every sample document:
The rest of the identity depends on which document you use:
first_name and last_name are the exception: the sandbox echoes the names you send in expected_details onto the fabricated document, so name matching passes with any name.
Use the SANDBOX_OCR_FULL_NAME_MISMATCH_WITH_PROVIDED magic value to exercise a name mismatch, and SANDBOX_OCR_DOB_MISMATCH_WITH_PROVIDED for a date-of-birth mismatch.
If your workflow restricts
documents_allowed to a country or document type that excludes the Brazil ePassport, the sandbox fabricates a document from the first allowed country instead, so nationality, id_country, and the document name follow that country. The dates above stay the same.OTP codes and email opt-in
- Phone OTP: the sandbox phone check accepts any well-formed code (4-8 digits;
123456included). Malformed input still returns400. - Email OTP: the sandbox email check accepts any well-formed code (
123456included). Malformed input still returns400.
Driving outcomes: scenarios, magic values, arming, and the simulate endpoint
There are four ways to control a sandbox session’s outcome.1. sandbox_scenario at session create
Set the scenario slug when creating the session (POST /v3/session/). The create flow expands the scenario’s bundled magic values into the session’s input fields, so the mocked providers emit the intended outcome through the real workflow pipeline.
2. Magic values typed by hand
Set the individual input fields yourself (for exampleexpected_details.first_name = "SANDBOX_OCR_DOCUMENT_EXPIRED", or user_email = "sandbox+aml_hit@didit.test"). See the magic values table above for the full registry.
3. Arm (or re-arm) the session before the flow starts
Set or replace the armed scenario on a session that already exists, as long as it hasn’t progressed pastNot Started. This is the endpoint the pre-flow scenario picker calls, and you can call it yourself to build a custom picker or test harness:
- Authenticate with the session’s own
Session-Token(returned assession_tokenfrom session create), not your application API key: this is a client-facing endpoint. - Returns
400for an unknown scenario slug, and400once the session has moved pastNot Started("Scenario can only be armed before the verification starts."). - Returns
404when theSession-Tokenbelongs to a live (non-sandbox) application, or doesn’t match thesession_idin the path. - Re-arming replaces the previous scenario. It clears only the magic values the previous scenario wrote, and leaves anything the user already typed by hand (email, first name, etc.) untouched. For example: arm
decline_phone_high_risk, then armapprove- the phone number reverts to unset, but a customer-entered email survives both calls.
4. The simulate endpoint
Force a terminal status after the fact:- Console / API key (requires the
write:sessionsprivilege):POST /v3/session/{session_id}/simulate/ - Hosted flow (
Session-Tokenheader):POST /v3/session/{session_id}/sandbox/simulate/
new_status, scenario, risk, comment, node_id — all optional, but at least one of new_status, scenario, or risk is required. When only scenario or risk is given, new_status defaults to that scenario’s / risk’s default status, and the matching warning Log is written.
Where sandbox_scenario appears
The armed scenario slug (null if none is armed) is echoed back on some surfaces and intentionally left off others:
If your integration needs to branch on the armed scenario server-side, read it from the webhook envelope or either decision endpoint (
v1 or v3).
Usage and billing
Sandbox usage is tracked, never charged:- Every mocked call still records a usage event (
is_sandbox: true, priced at0.0000) so sandbox volume is visible for debugging, but it is never added to your usage totals, never decremented from balance, and never appears on an invoice. - The Business Console’s balance, top-up, and live-usage surfaces filter sandbox usage out by default. The top-up usage endpoints accept an
environmentparameter (live, the default, orsandbox) so sandbox volume can be inspected separately - always at zero cost and with no free-tier consumption. - Email and phone verification bill per request rather than per session outcome, and sandbox has no way to fully mirror that at the webhook layer. Sandbox email/phone checks still record a usage event per request at price
0.0000, same as every other mocked feature: this is an accepted, known divergence from live billing behavior, not a bug. - Database validation’s response shape in sandbox intentionally diverges from the live per-provider shape, since there is no real provider to mirror. Treat sandbox database-validation payloads as a stand-in for the outcome (status and warning code), not a byte-for-byte preview of a live provider response.