Skip to main content
DigiLocker is a government-backed platform that allows users to securely store and share official documents, such as Aadhaar, PAN, and Driving License.
Cashfree integrates with DigiLocker to enable a consent-based KYC process. You redirect users to the DigiLocker portal, where they log in and approve document sharing. Cashfree retrieves the verified data securely after user consent.
Cashfree’s DigiLocker flow is compliant with UIDAI guidelines and the Digital Personal Data Protection (DPDP) Act. It supports multiple document types, uses a trusted government portal, and requires minimal changes to your existing integration.
You can verify Aadhaar, PAN, Driving License, and other government-issued documents supported by DigiLocker.
You can use this solution in banking, lending, insurance, logistics, fintech, trading, and mobility services to meet KYC and compliance requirements.
Use the Verify Account API to check if the user has a DigiLocker account (optional).

Use the Create URL API to generate a consent link.

Redirect the user to the DigiLocker portal for login and consent.

Use the Get Verification Status API to check the user’s progress (optional).

Use the Get Document API to retrieve the verified document.
You can receive the following status values:

  • PENDING – The user has not completed the verification.
  • AUTHENTICATED – The user has logged in and given consent.
  • EXPIRED – The link expired before completion.
  • CONSENT_DENIED – When user rejects or denies consent.
No. The data format remains the same as the previous flow. You can enable DigiLocker verification with minimal or no code changes.
The DigiLocker API (POST /verification/digilocker) requires separate account-level activation in addition to general Secure ID access. If PAN and GSTIN verification work but this endpoint returns 404, follow these steps:
  1. Confirm you are using Secure ID credentials (x-client-id and x-client-secret), not Payment Gateway keys. Using PG keys against Secure ID endpoints is a common cause of this error.
  2. If your credentials are correct, fill out the Support Form to request DigiLocker activation on your account.
The eaadhaar field returns N when the Aadhaar document isn’t available in the user’s DigiLocker account. This usually happens when the user registered with DigiLocker using only a mobile number and hasn’t linked their Aadhaar. It doesn’t mean the user denied consent. If the user denies consent, the verification status is CONSENT_DENIED instead.To fetch the Aadhaar document, ask the user to log in to DigiLocker and link their Aadhaar. Then start a new session by calling the Create DigiLocker URL API with a new verification_id, and ask the user to log in and give consent again.
This error means the credentials and the endpoint belong to different environments. Use production credentials (x-client-secret) with https://api.cashfree.com/verification, and test credentials with https://sandbox.cashfree.com/verification. Do not mix credentials from one environment with the endpoint of the other. See View end points for the full URLs.
No. Cashfree’s DigiLocker integration currently retrieves and returns only document data in XML format. It does not currently support or expose the digitally signed PDF available via DigiLocker’s /file/{uri} endpoint.
Yes. The Get Document API retrieves the Aadhaar document whichever way the user logs in. If the user logs in with their mobile number, their DigiLocker account must already be linked to Aadhaar. If the user logs in with their Aadhaar number, the linkage is generally available automatically. In both cases, the user must also give consent to share the Aadhaar document.
If the Get Document API returns the status AADHAAR_NOT_LINKED, the user must log in to DigiLocker and link their Aadhaar manually. This is the same scenario as the eaadhaar field returning N.Calling the API again doesn’t resolve this. DigiLocker records consent when the user logs in, so linking Aadhaar afterwards doesn’t update the existing session. After the user links their Aadhaar, complete these steps:
  1. Call the Create DigiLocker URL API with a new verification_id.
  2. Ask the user to log in to DigiLocker and give consent again.
  3. Call the Get Document API with the new verification_id.
No. The Get Document API fetches documents in real time once the verification status is AUTHENTICATED. Repeated calls are billed and don’t change the result within the same session.Instead, call the Get Document API once after you receive the DIGILOCKER_VERIFICATION_SUCCESS webhook. Before you call it, verify that user_details.eaadhaar is Y and that document_consent includes AADHAAR.
The DigiLocker URL is valid for 10 minutes from the time you generate it. If it expires before the user completes the flow, the verification status becomes EXPIRED and Cashfree triggers the DIGILOCKER_VERIFICATION_LINK_EXPIRED webhook. To continue, call the Create DigiLocker URL API again with a new verification_id.