Skip to navigation

Mock document verification

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.

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

1

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.

Legal ID SDK mock start screen titled Take a photo of your government-issued photo ID, with an Open camera button and 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. Use this option on devices without a camera or in automated tests.
2

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.
3

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.

See Images ›Hide Images ⌄Mock capture screen titled Capture the front of your ID, showing a camera preview, a Capture front button, and a Back link.Mock capture screen titled Capture the back of your ID, showing a camera preview, a Capture back button, and a Back link.

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

4

Choose a mock outcome

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

See Image ›Hide Image ⌄Choose mock outcome screen with Complete verification and Fail verification buttons, and a Lookup Test Persona field with a Verify as Test Persona button.
OptionResult
Complete verificationVerification succeeds and returns the default mock identity, Jane Marie Doe.
Fail verificationVerification fails with the doc_capture_failed error.
Verify as Test PersonaVerification returns the test persona that matches the phone number you enter. See Return a specific test persona.
5

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.

See Image ›Hide Image ⌄Review screen titled Is your information displayed correctly?, showing the test persona's name, date of birth, home address, and mobile phone number.

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 enteredResult
Matches a test personaVerification succeeds with that persona’s name, birth date, and address.
Starts with 999Verification fails. The last four digits choose the error, as shown in the next table.
Any other numberVerification succeeds and returns the default mock identity, Jane Marie Doe.

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.

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 digitsError codeDescription
2001document_minorThe document holder does not meet the age requirement.
2002document_expiredThe document is expired.
2003document_front_back_mismatchThe front and back document images do not match.
2004doc_capture_failedThe document images could not be read.
2005document_verification_failedThe 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.

File nameResult
success.jpgThe residency document is accepted.
fail.jpgThe residency document is denied.
Any other file nameThe 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.

The default persona is Veronica Persinger (8889413032). See the full list on the 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 codeWhen it is returned
camera_permission_deniedThe user denied camera access.
doc_capture_failedThe camera is missing or cannot be read, the user selected Fail verification, or the persona phone number ends in 2004.
user_no_idThe user selected the option to verify another way. This option only appears if your integration has one set up.