Skip to main content
POST
https://api.stablepay.global
/
v2
/
users
/
{userId}
/
kyc
/
digilocker
Verify DigiLocker
curl --request POST \
  --url https://api.stablepay.global/v2/users/{userId}/kyc/digilocker \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "redirectUrl": "<string>",
  "deviceId": "<string>"
}
'

DigiLocker Verification

DigiLocker verification allows users to share their Aadhaar and PAN documents directly from the government DigiLocker service. This is a more user-friendly alternative to Aadhaar OTP verification.

Flow Overview

  1. Initialize - Get a DigiLocker consent URL
  2. User Consent - User opens URL and grants consent in DigiLocker app
  3. Check Status - Poll status until verification completes

Initialize DigiLocker Session

redirectUrl
string
Optional URL to redirect user after DigiLocker consent
deviceId
string
required
Device fingerprint/ID for FIU compliance. Must be captured from the client device.

Request

curl -X POST https://api.stablepay.global/v2/users/usr_abc123/kyc/digilocker/init \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "redirectUrl": "https://yourapp.com/kyc/callback",
    "deviceId": "device-fingerprint-12345"
  }'

Response

{
  "success": true,
  "data": {
    "clientId": "digilocker_abc123xyz",
    "url": "https://digilocker-sdk.notbot.in/?gateway=production&type=digilocker&token=...",
    "expiresIn": 600,
    "message": "DigiLocker URL generated. Open this URL for user to complete verification."
  }
}
Direct the user to the url to complete DigiLocker consent. The session expires in 10 minutes.

Check DigiLocker Status

Poll this endpoint to check if the user has completed DigiLocker consent.

Request

curl -X GET https://api.stablepay.global/v2/users/usr_abc123/kyc/digilocker/status?clientId=digilocker_abc123xyz \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (Verified)

{
  "success": true,
  "data": {
    "status": "VERIFIED",
    "verified": true,
    "aadhaar": {
      "name": "RAHUL SHARMA",
      "dob": "1990-05-15",
      "gender": "M",
      "address": "123 Main Street, Mumbai, Maharashtra",
      "maskedAadhaar": "XXXX-XXXX-1234",
      "pincode": "400001",
      "state": "Maharashtra",
      "district": "Mumbai"
    },
    "pan": {
      "number": "ABCDE1234F",
      "name": "RAHUL SHARMA"
    }
  }
}

Response (Pending)

{
  "success": true,
  "data": {
    "status": "PENDING",
    "verified": false,
    "message": "Waiting for user to complete DigiLocker verification"
  }
}

Response (Expired)

{
  "success": false,
  "data": {
    "status": "EXPIRED",
    "verified": false,
    "error": "DigiLocker session has expired. Please generate a new token."
  }
}

Status Values

StatusDescription
PENDINGUser has not completed DigiLocker consent yet
VERIFIEDVerification complete, Aadhaar data available
FAILEDUser cancelled or verification failed
EXPIREDSession expired before completion

Benefits Over Aadhaar OTP

FeatureDigiLockerAadhaar OTP
User ExperienceSingle consent flowEnter OTP manually
Document AccessAadhaar + PAN in one flowAadhaar only
SecurityOAuth 2.0 basedSMS OTP
Consent RecordGovernment maintainedNone

Errors

CodeDescription
SESSION_NOT_FOUNDInvalid clientId or session expired
ALREADY_VERIFIEDDigiLocker already verified for this user
SERVICE_UNAVAILABLEDigiLocker service temporarily unavailable