X-Client-ID and X-API-Key.
These are v1 endpoints: responses use the v1 shape, there is no Idempotency-Key support, and billing is signalled by chargeble. See Migrate from v1.
1
Optional: check the user has a DigiLocker account
result.registered is true with code 1004 when the mobile number has an account, and false with code 2002 when it does not. Both come back with status: "success". If there is no account, set redirect_to_signup: true in the next step so the user can create one.2
Start a session
url. idto generates the PKCE pair for the DigiLocker authorisation and hands the verifier back to you on the callback.3
Handle the callback
After consent the user returns to your
redirect_url with four query parameters:Check
state matches the user you started the session for, then exchange the code straight away: it is single-use and short-lived.4
Exchange the code for a reference key
reference_key is valid for one hour. Use it for every call that follows.5
Read the user's details
user object with name, dob, gender, mobile, email, digilockerid, eaadhaar and picture, plus reference_key.6
Fetch the Aadhaar record
Content-Type, not JSON. Save it as a file.Inside a verification session
user_details and fetch_aadhaar accept an optional workflow_session_token. Pass it when this step runs inside a KYC workflow session so the step is charged once, by the session.
Alternative: the v2 exchange
If you already hold acode and code_verifier, POST /v2/verify/digilocker exchanges them and returns the identity in the v2 envelope with IDTO_* codes. See the DigiLocker reference.