> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.id.me/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.id.me/_mcp/server.

# Mock document verification

> Use the Legal ID SDK mock to test document verification in sandbox, choose pass or fail outcomes, return a specific test persona, and mock residency document uploads.

The Legal ID SDK mock lets you test the document verification flow from start to finish without a real ID. The mock goes through the same steps as the production SDK, including the camera permission request and the front and back capture. Then you choose the result to return: pass, fail, or a specific [test persona](/guides/test-personas).

> **Warning**
>
> The mock is only available in sandbox. Never use real personal information or real identity documents when testing.

## Enable mock mode

Mock mode is set for each integration. When it is on, ID.me loads the mock SDK instead of the production SDK. Your integration code does not change. Contact your ID.me account manager to turn on mock mode for your sandbox integration.

## Go through the mock flow

#### Start verification

Start a verification that requires a legal ID. The mock opens on the same start screen as the production SDK. It also adds a **Skip Camera** link.

* Select **Open camera** to go through the camera permission and capture steps.
* Select **Skip Camera** to go straight to [Choose a mock outcome](#choose-a-mock-outcome). Use this option on devices without a camera or in automated tests.

#### Allow camera access

When you select **Open camera**, the browser asks for permission to use the camera. The mock only asks for the camera, not the microphone.

* If you allow access, a live camera preview opens.
* If you deny access, the SDK returns the `camera_permission_denied` error.
* If the camera is missing or cannot be read, the SDK returns the `doc_capture_failed` error.

#### Capture the front and back of the ID

Hold any card up to the camera and select **Capture front**, then **Capture back**. The mock does not read or keep these images. You can capture anything.

<details>
  <summary>
    See Images ›

    Hide Images ⌄
  </summary>
</details>

Select **Back** at any time to return to the start screen and start over.

#### Choose a mock outcome

After you capture both sides, or if you selected **Skip Camera**, the **Choose mock outcome** screen opens.

<details>
  <summary>
    See Image ›

    Hide Image ⌄
  </summary>
</details>

| Option                     | Result                                                                                                                                                |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Complete verification**  | Verification succeeds and returns the default mock identity, Jane Marie Doe.                                                                          |
| **Fail verification**      | Verification fails with the `doc_capture_failed` error.                                                                                               |
| **Verify as Test Persona** | Verification returns the test persona that matches the phone number you enter. See [Return a specific test persona](#return-a-specific-test-persona). |

#### Review the result

The mock closes and the result goes back to ID.me. When verification succeeds, the user sees their information so they can confirm it, just like in production.

<details>
  <summary>
    See Image ›

    Hide Image ⌄
  </summary>
</details>

## Return a specific test persona

To test with a specific identity, enter a persona's phone number in **Lookup Test Persona** and select **Verify as Test Persona**. The button stays off until the field has at least one digit.

ID.me removes spaces, dashes, and parentheses from the number before it looks for a match. So `(888) 789-1962`, `888-789-1962`, and `8887891962` all find the same persona.

| Phone number entered                            | Result                                                                                 |
| ----------------------------------------------- | -------------------------------------------------------------------------------------- |
| Matches a [test persona](/guides/test-personas) | Verification succeeds with that persona's name, birth date, and address.               |
| Starts with `999`                               | Verification fails. The last four digits choose the error, as shown in the next table. |
| Any other number                                | Verification succeeds and returns the default mock identity, Jane Marie Doe.           |

> **Info**
>
> In the SDK mock, every matching persona succeeds, including the scenario and generic failure personas. Only the persona's identity data is used. To test a failure, use a phone number that starts with `999`. Persona scenarios apply to [mock document uploads](#pick-a-persona-with-a-file-name).

To get a specific error, start the phone number with `999` and end it with one of these codes. For example, `9995552002` returns `document_expired`. If the last four digits do not match a code, ID.me picks one of these errors at random.

| Last four digits | Error code                     | Description                                            |
| ---------------- | ------------------------------ | ------------------------------------------------------ |
| `2001`           | `document_minor`               | The document holder does not meet the age requirement. |
| `2002`           | `document_expired`             | The document is expired.                               |
| `2003`           | `document_front_back_mismatch` | The front and back document images do not match.       |
| `2004`           | `doc_capture_failed`           | The document images could not be read.                 |
| `2005`           | `document_verification_failed` | The document could not be verified.                    |

## Mock residency documents

Some flows ask the user to prove where they live, for example with the **Prove your residency another way** option. In sandbox, these uploads are mocked too. The name of the uploaded file decides the result, just like the [Services API document mocks](/apis/services-api/mock-apis-and-testing-tokens#document-mock-apis).

| File name           | Result                              |
| ------------------- | ----------------------------------- |
| `success.jpg`       | The residency document is accepted. |
| `fail.jpg`          | The residency document is denied.   |
| Any other file name | The residency document is accepted. |

The file name is not case sensitive, and the file extension does not matter. For example, `SUCCESS.png` and `fail.pdf` both work. If you upload more than one file and any of them is named `fail`, the document is denied.

### Pick a persona with a file name

To get a specific test persona from a mock ID document upload, name the file with the persona's phone number, for example `8887891962.jpg`. To give the file a more useful name, put an underscore after the phone number, for example `8887891962_front.jpg`. ID.me only uses the part before the first underscore to find the persona.

For a document upload, ID.me uses the persona's identity data and its scenario. For example, `8884175429.jpg` returns Javier Medhurst with the expired document outcome. If you also upload a file named `success` or `fail`, that file name decides the result instead of the persona's scenario.

If no file name matches a persona, ID.me returns the default persona.

> **Info**
>
> The default persona is Veronica Persinger (`8889413032`). See the full list on the [test personas](/guides/test-personas) page.

## Error codes

These are the errors you can get from the mock. Use them to test how your app handles errors.

| Error code                 | When it is returned                                                                                                           |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `camera_permission_denied` | The user denied camera access.                                                                                                |
| `doc_capture_failed`       | The camera is missing or cannot be read, the user selected **Fail verification**, or the persona phone number ends in `2004`. |
| `user_no_id`               | The user selected the option to verify another way. This option only appears if your integration has one set up.              |