post
https://test-accounts.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://test-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://test-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
{
"url": "https://digilocker.example.com/auth/...",
"message": "Digilocker link generated successfully"
}Failure scenario
Failure scenario
- 422 — Signatory details missing
{
"error": "Signatory details required"
}- 200 — Already completed (idempotent)
{
"message": "Digilocker KYC is already completed"
}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 |
Request parameters
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
