DigiLocker document fetch API
Pull issued documents straight from the user’s DigiLocker.
Overview
The customer logs in to DigiLocker and approves access. You receive the original issued document (Aadhaar, PAN, DL, marksheets and more) as signed XML or PDF, so there is nothing to fake.
POST/v1/digilocker/session
Where it’s used
- Paperless onboarding
- Education and certificate checks
- Insurance and lending KYC
How the check runs
- You create a session with the documents you want and a redirect URL.
- We return a hosted link. Open it in a browser or web view.
- The user logs in to DigiLocker with their Aadhaar or mobile and approves sharing the selected documents.
- They are redirected back to your app, and we post the result to your webhook.
- Fetch the documents and parsed fields with the session ID.
Request
| Field | Description |
|---|---|
redirect_url | Where to send the user after consent |
documents | List, e.g. ["AADHAAR","PAN"] |
consent | "Y" once your user has agreed to the check. Required for any check on a person. |
curl -X POST https://api.yetlix.com/v1/digilocker/session \
-H "x-client-id: $YETLIX_CLIENT_ID" \
-H "x-client-secret: $YETLIX_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{"redirect_url":"https://app.example.com/kyc/done","documents":["AADHAAR","PAN"],"consent":"Y"}'
{
"status": "success",
"request_id": "req_7Hq2kD91",
"data": {
"session_id": "dl_5c7e1b",
"url": "https://verify.yetlix.com/d/5c7e1b",
"expires_in": 900
}
}
Response fields
Inside the data object. The envelope (status, request_id, billable, timestamp) is the same for every API and is described in the docs.
| Field | Type | Meaning |
|---|---|---|
session_id | string | Use it to fetch results or match the webhook. |
url | string | Hosted DigiLocker consent link. |
expires_in | integer | Seconds until the link expires. |
documents[].type | string | AADHAAR, PAN, DRIVING_LICENCE, etc. (in the result) |
documents[].issuer | string | Issuing authority as recorded by DigiLocker. |
documents[].fields | object | Parsed fields for that document type. |
documents[].file | string | Signed XML or PDF, base64. |
Outcomes and what to do
Every check can end in a handful of ways. Decide up front what your product does in each case, so nothing falls through to a support ticket.
COMPLETED
User shared all requested documents.
Do this: Use the parsed fields; store the signed file as KYC evidence.
PARTIAL
Some documents were not in the user’s locker.
Do this: Ask for the missing ones another way.
DENIED / EXPIRED
User declined or didn’t finish.
Do this: Offer a retry or another path.
Sandbox test values
Send these values in redirect_url with your sandbox key to get each result. Anything else returns INVALID_INPUT in sandbox.
| Value | Returns |
|---|---|
https://app.example.com/kyc/done | Session created |
Best practices
- Issued documents can’t be faked, which makes DigiLocker the strongest option for paperless KYC when users have the documents in their locker.
- Always handle the webhook. Users often close the tab before the redirect happens.
Compliance note. Documents issued to a user’s DigiLocker account are treated as equivalent to originals under the IT (Preservation and Retention of Information by Intermediaries Providing Digital Locker Facilities) Rules, 2016, and regulators accept them as e-documents for KYC.
Frequently asked
What if the user has no DigiLocker account?
They can create one inside the flow using Aadhaar and mobile OTP; it takes about a minute.
Can I fetch marksheets or degrees?
Yes, where the board or university issues to DigiLocker. Tell us which issuers you need.