DigiLocker Create Consent URL

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

📘

Before you call this API

Send your issued secret header and Content-Type: application/json. Your source IP must be registered on the partner account, and the account, KYC, wallet, API access, and DigiLocker service must be active. The body ip field does not replace the source-IP check.

Creates the URL where the user logs in or signs up and grants access to the requested documents.

POST https://pay2new.in/apis/v1/verification/digilocker/createUrl

Request fields

FieldTypeRequiredValidation / Description
mobile_numberstringYesExactly 10 numeric digits.
document_requestedarrayYesOne or more of AADHAAR, PAN, DRIVING_LICENSE.
user_flowstringYesExact lowercase value signin or signup.
redirect_urlstringYesClient URL to which the user is redirected after the journey. HTTPS is recommended.
latitudedecimalYesCustomer/outlet latitude.
longitudedecimalYesCustomer/outlet longitude.
ipstringYesValid IPv4 address.
request_idstringYesUnique request reference, minimum 8 characters.

cURL example

curl --request POST \
  --url 'https://pay2new.in/apis/v1/verification/digilocker/createUrl' \
  --header 'secret: <YOUR_PAY2NEW_SECRET>' \
  --header 'Content-Type: application/json' \
  --data '{
    "mobile_number": "9999999999",
    "document_requested": ["AADHAAR", "PAN"],
    "user_flow": "signin",
    "redirect_url": "https://client.example.com/kyc/digilocker/callback",
    "latitude": "19.0760",
    "longitude": "72.8777",
    "ip": "203.0.113.10",
    "request_id": "DLURL202608260001"
  }'

Success response example

{
  "status": 1,
  "message": "Transaction Success",
  "order_id": "P2NDL202608260001",
  "request_id": "DLURL202608260001",
  "txn_value": "2.00",
  "balance": "998.00",
  "operator_reference": 12345678,
  "url": "https://verification.example/dgl/temporary-token"
}

🚧

Persist both values

Use response order_id and operator_reference in the next two API calls. Redirect the user only to the URL returned by the API. Amounts in this example are illustrative; actual values follow the client package.

🚧

Check the application result

Always inspect JSON status, message, and any errors object. A successful HTTP response does not establish verification completion. Invalid JSON, invalid parameters, authentication failure, or unavailable service can return status: 2. For field validation errors, errors maps field names to messages.

See the Verification Integration Guide for the full consent journey, status handling, and examples.

Body Params
string
required

Exactly 10 numeric digits.

document_requested
array of strings
required

One or more of AADHAAR, PAN, DRIVING_LICENSE.

document_requested*
string
required

signin or signup.

string
required

Your consent-return URL; HTTPS recommended.

string
required

Decimal latitude.

string
required

Decimal longitude.

string
required

Valid IPv4 address.

string
required

Unique reference, minimum 8 characters.

Headers
string
required

Pay2New-issued API secret.

Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json