Skip to main content
GET
/
digilocker
/
document
/
{document_type}
Get Document
curl --request GET \
  --url https://sandbox.cashfree.com/verification/digilocker/document/{document_type} \
  --header 'x-client-id: <api-key>' \
  --header 'x-client-secret: <api-key>'
import requests

url = "https://sandbox.cashfree.com/verification/digilocker/document/{document_type}"

headers = {
    "x-client-id": "<api-key>",
    "x-client-secret": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
  method: 'GET',
  headers: {'x-client-id': '<api-key>', 'x-client-secret': '<api-key>'}
};

fetch('https://sandbox.cashfree.com/verification/digilocker/document/{document_type}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://sandbox.cashfree.com/verification/digilocker/document/{document_type}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-client-id: <api-key>",
    "x-client-secret: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.cashfree.com/verification/digilocker/document/{document_type}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-client-id", "<api-key>")
	req.Header.Add("x-client-secret", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://sandbox.cashfree.com/verification/digilocker/document/{document_type}")
  .header("x-client-id", "<api-key>")
  .header("x-client-secret", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.cashfree.com/verification/digilocker/document/{document_type}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'

response = http.request(request)
puts response.read_body
{ "reference_id": 408, "verification_id": "test001", "status": "SUCCESS", "uid": "xxxxxxxx5647", "care_of": "S/O: Fakkirappa Dollin", "dob": "02-02-1995", "gender": "M", "name": "Mallesh Fakkirappa Dollin", "photo_link": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHB", "split_address": { "country": "India", "dist": "Haveri", "house": "Shri Kanaka Nilaya", "landmark": "", "pincode": "581115", "po": "Ranebennur", "state": "Karnataka", "street": "Umashankar Nagar 1st Main 5th Cross", "subdist": "Ranibennur", "vtc": "Ranibennur" }, "year_of_birth": 2000, "xml_file": "<xml file link with 48hrs expiry>", "message": "Aadhaar Card Exists" }
Currently we do not support downloading of full documents through Digilocker API. This feature will be added in the future enhancements.

Authorizations

x-client-id
string
header
required

Your unique client identifier issued by Cashfree. You can find this in your Merchant Dashboard.

x-client-secret
string
header
required

The secret key associated with your client ID. Use this to authenticate your API requests. You can find this in your Merchant Dashboard.

Headers

x-cf-signature
string

Send the signature if two-factor authentication is selected as Public Key. More details.

Path Parameters

document_type
enum<string>
required

It is the type of document to be verified.

Available options:
AADHAAR,
PAN,
DRIVING_LICENSE

Query Parameters

reference_id
integer

It is the unique ID created by Cashfree Payments that you receive in the response of Create DigiLocker URL API. format: int64

verification_id
string

It is the unique ID you created to identify the Create DigiLocker URL API request.

Response

Success response for retrieving the document from DigiLocker.

care_of
string

It displays the name of the parent or guardian.

Example:

"John Snow"

dob
string

It displays the date of birth of the individual.

Example:

"02-02-1995"

gender
string

It displays the gender of the individual.

Example:

"M"

name
string

It displays the name of the individual.

Example:

"John Doe"

year_of_birth
integer

It displays the year of birth of the individual.

Example:

2000

It displays the Base64-encoded image of the individual whose document is to be retrieved.

Example:

"PHOTO_LINK"

message
string

It displays details about the success or failure of the API request.

Example:

"Aadhaar Card Exists"

reference_id
integer

It displays the unique ID created by Cashfree Payments for reference purposes. format: int64

Example:

1234

status
string

It displays the status of the aadhaar document fetch. Possible values are:

  • SUCCESS: Aadhaar successfully fetched
  • AADHAAR_NOT_LINKED: Aadhaar not linked
Example:

"SUCCESS"

split_address
object

It contains the address information in individual components.

Example:
{
  "country": "India",
  "dist": "Haveri",
  "house": "House",
  "landmark": "Landmark",
  "pincode": "581112",
  "po": "Post Office",
  "state": "State",
  "street": "Street",
  "subdist": "SubDist",
  "vtc": "Vtc"
}
uid
string

It displays the unique number assigned to the individual when applying for the aadhaar card.

Example:

"xxxxxxxx5678"

verification_id
string

It displays the unique ID you created to identify the verification request.

Example:

"ABC00123"

xml_file
string

It is the link which points to the zip file containing the XML file and has 48 hrs expiry.

Example:

"https://abc.xyz"