Skip to content

DigiLocker PAN API

New

Read a person's PAN record from their DigiLocker, with their consent, and get the name, date of birth and status from the record the issuer placed there.

Overview

A PAN in a person's DigiLocker is placed there by the tax department that issued it. It carries the holder's name, date of birth and the PAN's status, from the issuer itself. Lenders and fintech platforms usually ask for a photo of a PAN card and check it against a database. A PAN from DigiLocker arrives with the person's consent and from the issuer. Once the person has opened a DigiLocker session and consented, your application sends the session reference with the PAN and the name on it, and gets back the PAN record as structured data, with the number masked.

Category
KYC Services
Coverage
People whose DigiLocker holds their PAN and who consent
Input
A DigiLocker session reference, the PAN and the name on it
Output
Masked PAN, holder name, date of birth and PAN status
Typical users
Lenders and NBFCs, fintech platforms, brokerages and wealth platforms, payroll teams
Coverage note
Only people whose DigiLocker holds their PAN and who open a session and consent

The overview and the sections after the reference are the FinSour API catalog’s own record for this service, rendered unaltered.

Endpoint URL and method

POSThttps://gateway.staging.finsour.io/v1/identity/digilocker-pan

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Authentication

Scheme API key travels in the X-Api-Key header

Send your API key in this header on every call, from your own server: a key sent from a browser is refused. A key starting fs_test_ calls the sandbox and one starting fs_live_ calls production, at the same address. Create keys in the FinSour console.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Request parameters

Content type application/json

Headers

NameTypeRequiredDescriptionConstraints
Idempotency-KeystringRequiredA key you generate for each attempt. Sending the same key again returns the first answer instead of running the check twice; the same key with a different body is refused.8 to 255 characters. Matches ^[A-Za-z0-9._:-]+$

Body

NameTypeRequiredDescriptionConstraints
inputobjectRequiredThe details to check.—
input.sessionIdstringRequired—Matches ^dls_[0-9A-HJKMNP-TV-Z]{26}$
input.panNumberstringRequired—Matches ^[A-Z]{5}[0-9]{4}[A-Z]$. Exactly 10 characters
input.nameOnPanstringRequired—Matches ^[A-Za-z ]+$. 1 to 120 characters
optionsobjectRequiredSettings for this call. This API requires consent.—
options.referencestringOptionalYour own reference for this call. It comes back unchanged as meta.reference.1 to 128 characters
options.consentobjectRequiredThe person's consent to this check.—
options.consent.obtainedbooleanRequiredSend true once the person has agreed to the check.Always true
options.consent.atstring (date-time)RequiredWhen the person gave consent.—
options.consent.purposestringRequiredWhat the check is for, for example kyc.1 to 64 characters

Request samples

cURL

curl -X POST https://gateway.staging.finsour.io/v1/identity/digilocker-pan \
  -H "X-Api-Key: $FINSOUR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "sessionId": "<sessionId>",
    "panNumber": "<panNumber>",
    "nameOnPan": "<nameOnPan>"
  },
  "options": {
    "consent": {
      "obtained": "<obtained>",
      "at": "<at>",
      "purpose": "<purpose>"
    }
  }
}'

Node.js

const response = await fetch("https://gateway.staging.finsour.io/v1/identity/digilocker-pan", {
  method: "POST",
  headers: {
    "X-Api-Key": process.env.FINSOUR_API_KEY,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "input": {
      "sessionId": "<sessionId>",
      "panNumber": "<panNumber>",
      "nameOnPan": "<nameOnPan>"
    },
    "options": {
      "consent": {
        "obtained": "<obtained>",
        "at": "<at>",
        "purpose": "<purpose>"
      }
    }
  }),
});

console.log(response.status, await response.json());

Python

import os
import uuid

import requests

response = requests.post(
    "https://gateway.staging.finsour.io/v1/identity/digilocker-pan",
    headers={
        "X-Api-Key": os.environ["FINSOUR_API_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "input": {
            "sessionId": "<sessionId>",
            "panNumber": "<panNumber>",
            "nameOnPan": "<nameOnPan>",
        },
        "options": {
            "consent": {
                "obtained": "<obtained>",
                "at": "<at>",
                "purpose": "<purpose>",
            },
        },
    },
    timeout=30,
)

print(response.status_code, response.json())

Generated from the fields above. Replace each value in angle brackets with your own; the key is read from FINSOUR_API_KEY.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Response schema

Status 200 · content type application/json

NameTypePresentDescriptionConstraints
dataobjectAlwaysThe result of the check.—
data.foundbooleanAlways——
data.panobject or any or nullAlways——
data.sourceobjectAlways——
data.source.fetchedAtstringAlwaysWhen the answer was fetched: RFC 3339 UTC with a Z, never an epoch or an IST offset.Matches ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Error codes

CodeStatusMeaningRetrying
API_VERSION_UNSUPPORTED400That API version is no longer supported.Do not retry automatically
IDEMPOTENCY_KEY_INVALID400That Idempotency-Key does not meet the required format.Do not retry automatically
IDEMPOTENCY_KEY_REQUIRED400An Idempotency-Key header is required for this request.Do not retry automatically
REQUEST_MALFORMED400The request could not be parsed.Do not retry automatically
AUTH_KEY_EXPIRED401The API key is not valid.Do not retry automatically
AUTH_KEY_INVALID401The API key is not valid.Do not retry automatically
AUTH_KEY_MISSING401No API key was presented.Do not retry automatically
AUTH_KEY_REVOKED401The API key is not valid.Do not retry automatically
INSUFFICIENT_BALANCE402The available balance is not enough for this request.Do not retry automatically
AUTH_IP_NOT_ALLOWED403This API key may not be used from this address.Do not retry automatically
ENTITLEMENT_MISSING403This organization is not entitled to that product in this environment.Do not retry automatically
ORGANIZATION_SUSPENDED403This organization is not active.Do not retry automatically
PRODUCT_NOT_AVAILABLE403That product is not available.Do not retry automatically
PRODUCT_RETIRED403That product has been withdrawn.Do not retry automatically
SCOPE_INSUFFICIENT403This API key does not carry the scope this product requires.Do not retry automatically
DIGILOCKER_SESSION_NOT_FOUND404No open DigiLocker session has that id.Do not retry automatically
PRODUCT_NOT_FOUND404No such product.Do not retry automatically
DIGILOCKER_CONSENT_PENDING409The person has not yet given consent on DigiLocker.Safe to retry
DIGILOCKER_STEP_INVALID409The DigiLocker session is not at this step.Do not retry automatically
IDEMPOTENCY_KEY_REUSED409That idempotency key was already used for a different request.Do not retry automatically
PRICE_UNAVAILABLE409No active price covers this product right now.Safe to retry
REQUEST_IN_PROGRESS409An earlier attempt with this key is still running.Safe to retry
SETTLEMENT_PENDING409This request is awaiting reconciliation by an operator.Do not retry automatically
API_VERSION_SUNSET410That API version passed its announced sunset date.Do not retry automatically
REQUEST_TOO_LARGE413The request body is too large.Do not retry automatically
UNSUPPORTED_MEDIA_TYPE415That content type is not accepted on this route.Do not retry automatically
CONSENT_REQUIRED422This product requires an explicit consent flag.Do not retry automatically
DIGILOCKER_CONSENT_DENIED422The person did not give consent on DigiLocker.Do not retry automatically
DIGILOCKER_DETAILS_MISMATCH422The details do not match the person's DigiLocker record.Do not retry automatically
DIGILOCKER_OTP_INVALID422The code was not accepted. Ask the person for the code they received and try again.Do not retry automatically
DIGILOCKER_SESSION_EXPIRED422The DigiLocker session has expired. Start a new session.Do not retry automatically
SANDBOX_FIXTURE_MISSING422No sandbox fixture exists for this input. Use a different test value.Do not retry automatically
UPSTREAM_REJECTED422The upstream source rejected the input.Do not retry automatically
VALIDATION_FAILED422The request payload is invalid.Do not retry automatically
CONCURRENCY_LIMIT429Too many simultaneous requests.Safe to retry
QUOTA_EXCEEDED429The allowance for this window is spent.Do not retry automatically
RATE_LIMITED429Too many requests.Safe to retry
INTERNAL_ERROR500An unexpected error occurred.Safe to retry
OUTCOME_UNCERTAIN502The outcome of this request is not yet known. Retry with the same Idempotency-Key.Do not retry automatically
UPSTREAM_UNAVAILABLE502The upstream source is unavailable. Retry shortly.Safe to retry
MAINTENANCE_MODE503The service is in a maintenance window.Safe to retry
NO_PROVIDER_AVAILABLE503No provider can serve this product right now.Safe to retry
SERVICE_OVERLOADED503The service is shedding load. Retry shortly.Safe to retry
UPSTREAM_TIMEOUT504The upstream source did not respond in time.Safe to retry

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Rate limits

ScopeLimitWindowAt the limit
Your API key, within your organisation's limitThe figure in X-RateLimit-LimitPer minute429 RATE_LIMITED, with Retry-After in seconds. Every answer past authentication carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Use cases

  • Lending: taking a borrower's PAN record from DigiLocker in a remote application
  • Broking and wealth: completing account opening with an issued PAN
  • Payroll: confirming a new employee's PAN with their consent
  • Fintech onboarding: replacing PAN card uploads with DigiLocker

What this service does

  • The PAN from its issuer

    The holder's name, date of birth and the PAN's status, from the record the issuing tax department placed in the person's DigiLocker.

  • The number arrives masked

    The PAN comes back with only its first three and last two characters shown.

  • Consent link or code

    Read it from a session opened by a consent link that asks for PAN, or by Aadhaar details and a one-time code.

  • A clear not-found answer

    When DigiLocker holds no matching PAN record, the response says so, and your flow can offer another route.

How a check runs

  1. Arrange access

    Tell us how DigiLocker PAN fits your onboarding. We arrange access for your organization under the applicable service contract.

  2. Open a DigiLocker session

    The person consents through a consent link that asks for PAN, or with their Aadhaar details and a code.

  3. Read the PAN

    Your application sends the session reference, the PAN and the name on it.

  4. Use the record

    Fill the PAN, name and date of birth on the application and act on the status.

  5. Store with the application

    Keep the record with the decision it supported, and limit who can see it.

Questions

What do I send to read a PAN from DigiLocker?
The reference of an open DigiLocker session, the PAN and the name printed on it.
What does the response include?
The masked PAN, the holder's name, their date of birth and the PAN's status, where the record holds them.
Can I read PAN through a consent link?
Yes. Ask for PAN when you create the consent link, and read it from the session once the person has consented.
How is this different from PAN Verification?
PAN Verification checks a PAN you send against the record. DigiLocker PAN reads the PAN the person shares from their own DigiLocker, with their consent, from the issuer.
Do I need the person's consent?
Yes. The DigiLocker session is the person's consent, and the read names their PAN, so use the result only for the purpose they agreed to.
How do I get access to the DigiLocker PAN API?
Start with Get API and tell us how DigiLocker fits your onboarding and what volumes you expect. We set up access under the applicable service contract.

Catalog entry last updated .