post
https://uat-partner.payu.in/api/v3/merchants//kyc_document/generate_digilocker_link
The Generate DigiLocker Link API creates a DigiLocker authentication URL for Aadhaar-based verification (Step 09 of 16).
Notes:
- Prerequisite: Step 08 (Signatory Details) — mandatory.
- Branching:
- Individual / Sole Prop — skip if CKYC succeeded; required if CKYC was skipped or failed
- All other entities — always required
- Redirect the merchant to the returned URL to complete DigiLocker authentication.
HTTP Method: POST
Environment
| URL | |
|---|---|
| Test Environment | https://uat-partner.payu.in/api/v3/merchants/{mid}/kyc_document/generate_digilocker_link |
| Production Environment | https://partner.payu.in/api/v3/merchants/{mid}/kyc_document/generate_digilocker_link |
Note: DigiLocker fails without Step 08 (Signatory Details). Use GetMerchant to check
entity_typeandckyc_statusbefore deciding whether DigiLocker is required.
Sample request
Sample request
curl --location 'https://uat-partner.payu.in/api/v3/merchants/{{mid}}/kyc_document/generate_digilocker_link' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"consent": true
}'Sample response
Success scenario
Success scenario
{
"status": "link_generated",
"capture_link": "https://api.digitallocker.gov.in/public/oauth2/1/authorize?response_type=code&client_id=CW7660E3C7&redirect_uri=https%3A%2F%2Fapi-in.perfios.com%2Fkyc%2Fapi%2Fv1%2Fdigilocker%2Fget-token&state=<JWT token, truncated>"
}{
"message": "Digilocker KYC is already completed"
}{"error_message": "Digilocker KYC is currently in progress, please try after some time"}Failure scenario
Failure scenario
- 422 — Signatory details missing
{
"error": "Signatory details required"
}Response parameters
Response parameters
| Parameter | Description | Example |
|---|---|---|
| url | string — DigiLocker authentication URL to open for the merchant | https://digilocker.example.com/auth/... |
| message | string — Status message | Digilocker link generated successfully |
Additional request parameters info
Header parameters
Header parameters
| Header | Description | Example |
|---|---|---|
Authorizationmandatory | string — Bearer token from Step 00 (GetToken) | Bearer {{access_token}} |
Content-Typemandatory | string — Must be application/json | application/json |
Path parameters
Path parameters
| Parameter | Description | Example |
|---|---|---|
midmandatory | string — Numeric merchant ID (mid) from Step 01 | 8390925 |
Body parameters
Body parameters
| Parameter | Description | Example |
|---|---|---|
consentmandatory | boolean — Must be true for Aadhaar verification consent | true |
400Bad Request
401Unauthorized - Invalid or expired token
403Forbidden - No access to this resource
404Not Found
422Validation Failed
500Internal Server Error
