Simulation Mode

When developing and testing your ID Check integration, you can use simulation mode to test different scenarios without performing actual liveness checks or ID scans. This makes development and testing much faster and more efficient.

Simulation mode is only available in the sandbox environment

How to Use Simulation Mode

To use simulation mode, simply add the simulate query parameter when getting an ID Check session_id.

When you navigate to the user with that session, the page will wait for 3 seconds before redirecting with the simulated response, mimicking the real-world flow.

The session will redirect with the same error or success case that you specified in the simulate parameter.

Available Simulation Cases

The following simulation cases are available for testing:

  • invalid_session_id - Simulates an invalid session ID error
  • session_id_not_found - Simulates a case where the session ID cannot be found
  • failed_to_get_camera_permission - Simulates a camera permission failure
  • failed_to_complete_face_scan - Simulates a face scan failure
  • failed_to_process_id_scan - Simulates an ID scan processing failure
  • failed_to_collect_device_data - Simulates a device data collection failure
  • liveness_check_failed - Simulates a failed liveness check
  • success - Simulates a successful verification

Example Testing Flow

  1. Add the simulate parameter to GET /liveness/session URL with the case you want to test
GET /liveness/session?simulate=liveness_check_failed

{
    "request_id": "c6716efe-3624-4813-9a59-175d8fee484c",
    "session_id": "{some-simulated-session-id}"
}
  1. Navigate to the ID Check URL like normal and wait 3 seconds
https://app.sandbox.verisoul.ai?session_id={some-simulated-session-id}
  1. The page will redirect you with the correct error or success message, bypassing any liveness or document checks
https://verisoul.ai?session_id={some-simulated-session-id}&success=false&error_message=liveness_check_failed

API Responses

When calling the API with sessions that have been simulated you can expect:

  • For success case: You will receive a response with stubbed data
  • For all other cases: You will receive a 400 response

The error responses in simulation mode may not exactly match the production error responses. They are intended for testing the basic flow of your integration.

This allows you to test your integration’s error handling and success flows without needing to perform actual verifications.