Keys
Each environment has its ownX-Client-ID and X-API-Key pair, and a pair from one environment does not authenticate against the other.
- Staging: ask your idto account manager. Staging keys are issued by hand.
- Production: generate them in the dashboard under API Credentials once your account has completed go-live. See the Go-live checklist.
Sandbox Mode in the dashboard
A new dashboard account opens in Sandbox Mode. In that mode the dashboard’s built-in API tester shows sample output in the browser and makes no API call. It is a way to explore response shapes, not a test environment, and nothing it shows reaches either base URL above. See the Dashboard guide.What differs between environments
What this means for your tests:
- The same input can give a different outcome. Because the source can differ, a placeholder or edge-case input can come back as
IDTO_001on one environment andIDTO_202on the other. Branch onerror_codeandbilled, and never hardcode the outcome of a specific input. - Handle
202on the employment and passbook routes. On staging,POST /verify/employment_history,/verify/uan_passbook_without_otpand/verify/pf_employee_passbookcan answer202withstatus: "pending",error_code: "IDTO_203", areference_idand aRetry-Afterheader. Fetch the result withGET /verify/result/{reference_id}after the number of seconds inRetry-After; it returns the same202until the result is ready, then the final response with its own status code. Areference_idthat is unknown, or belongs to another account, returns404withIDTO_207. Production does not return202on these routes today. - A slow bank can time out on staging only. Retry with the same
Idempotency-Keybefore treating it as a failure.
Check connectivity
GET /health on either base URL returns {"status":"ok"} with HTTP 200 and needs no keys. Use it to confirm that your servers can reach idto, for example from a new network or after a firewall change, before you debug a verification call.
Testing on staging
Because staging reaches live sources, plan your tests so that most of them never need one.- Input errors are free. A malformed PAN, Aadhaar number, IFSC or GSTIN, or missing consent, is rejected with
IDTO_001orIDTO_005and is never billed, so you can test every validation path as often as you like. A number with the right shape that no one holds may instead reach the source and come back as a billedIDTO_202. - Found and no-record results cost a credit each. Test them with a small set of identities you are authorised to verify, and reuse the same ones.
- Retries can be tested without extra charges. Send a request with an
Idempotency-Key, then send it again with the same key and body: the second call returns the stored response and is not billed. See Idempotency. - Billing is visible in every v2 response. Assert on the
billedfield in your tests rather than on your balance.
Promote to production
- Complete Switch to Production in the dashboard and recharge your production balance.
- Create a production key pair under API Credentials. The secret is shown once, when you create it, so copy it straight into your secret manager.
- If you use webhooks, set the webhook URL and generate a secret in the production dashboard. Webhook settings from staging do not carry over.
- Change the base URL and key pair in your production configuration. No code change is needed.
- Call
GET /health, then run one real verification and confirm the response carriesbilled: trueand atranx_id.
Rotate keys
You can hold more than one key pair in an environment. To rotate without downtime, create a new pair, deploy it, confirm traffic is flowing on it, then disable or delete the old pair in API Credentials. A disabled pair is rejected with HTTP 403 andClient is inactive, so you can disable first and delete once you are sure nothing still uses it.
Your webhook URL and secret are held on one of your active key pairs. After you disable or delete a pair, open the webhook settings and confirm the URL and secret are still set. If they are empty, set them again, or deliveries stop.
Next steps
Quickstart
Make a first call against staging.
Go-live checklist
Everything to confirm before you switch the base URL.