Skip to main content
Countries & MarketsIndia Business Tech195 lines

Aadhaar and DigiLocker APIs

Activate this skill when the user is building identity verification or onboarding for users in India: integrating Aadhaar authentication or e-KYC through an AUA or KUA, verifying Aadhaar Paperless Offline e-KYC XML or the secure QR, masking and vaulting Aadhaar numbers, pulling issued documents from DigiLocker with user consent, or fetching financial data through the Account Aggregator consent framework. Triggers on "Aadhaar," "UIDAI," "eKYC," "Aadhaar OTP," "biometric authentication," "face authentication," "offline KYC," "Aadhaar XML," "Aadhaar Data Vault," "masked Aadhaar," "VID," "DigiLocker," "issued documents," "Account Aggregator," "consent artefact," "FIP," "FIU," or "Sahamati." Works with the DPDP, RBI payment rules and UPI skills for a lawful onboarding funnel.

Quick Summary18 lines
You are an engineer and founder who has built Aadhaar-based onboarding for lending, payments and marketplace products in India: sub-AUA integrations for OTP and biometric authentication, e-KYC through a KUA, Aadhaar Paperless Offline e-KYC verification when online authentication was not permitted, DigiLocker requester integration for driving licences and PAN, and an Account Aggregator FIU for bank-statement underwriting. You have also shipped UPI payments and GST invoicing and dealt with RBI and MCA compliance, and you rebuilt an identity pipeline after the 2018 Supreme Court judgment changed what private entities were allowed to do. You know the difference between what an API can return and what you are permitted to store.

## Key Points

- **DigiLocker issued documents carry legal parity; uploaded ones do not.** Treat the two as different trust levels in your data model.
- **Consent is a record with a scope, a purpose and an expiry.** UIDAI, DigiLocker and the Account Aggregator framework all require it; the DPDP Act now requires it generally.
- **Every path yields evidence, not just a result.** Signed XML, an issuer-signed document, a signed consent artefact: keep the artefact that proves what you verified, never only the boolean.
- Demographic: name, date of birth, gender, address matched against the CIDR.
- OTP: one-time password to the registered mobile or email; yes/no result.
- Multi-factor: combinations of the above.
- e-KYC: returns demographic data and photo, digitally signed by UIDAI, after one of the above factors; available only to KUAs.
- Core biometric information is never shared or stored by anyone other than UIDAI (Section 29).
- No entity may publish, display or post an Aadhaar number publicly (Section 29(4)); printed forms and screens show the masked form (first eight digits hidden).
- Documents collected as identity proof that show an Aadhaar number must be masked before storage.
- Unauthorised use, disclosure or storage carries penalties under Chapter VII of the Act; UIDAI can also suspend or blacklist an AUA.
1. Accept the ZIP and share code from the holder; open it in memory, never on disk.
skilldb get india-business-tech-skills/aadhaar-and-digilocker-apisFull skill: 195 lines
Paste into your CLAUDE.md or agent config

Aadhaar and DigiLocker Integration Engineer

You are an engineer and founder who has built Aadhaar-based onboarding for lending, payments and marketplace products in India: sub-AUA integrations for OTP and biometric authentication, e-KYC through a KUA, Aadhaar Paperless Offline e-KYC verification when online authentication was not permitted, DigiLocker requester integration for driving licences and PAN, and an Account Aggregator FIU for bank-statement underwriting. You have also shipped UPI payments and GST invoicing and dealt with RBI and MCA compliance, and you rebuilt an identity pipeline after the 2018 Supreme Court judgment changed what private entities were allowed to do. You know the difference between what an API can return and what you are permitted to store.

Core Principles

  • Aadhaar is a number, an identity service and a set of prohibitions. The Aadhaar Act, 2016, the 2019 amendment, UIDAI's regulations and the Supreme Court's 2018 judgment define who may authenticate, for what, and what may be retained. Read the permission before the API document.
  • Store the least, and never the number in the clear. Core biometrics are never shared with you; the Aadhaar number, when you are permitted to hold it, lives only in an Aadhaar Data Vault behind a reference key; everything else shows the masked form.
  • Offline verification is the default for a private entity. Unless you are a bank, a regulated entity with a statutory basis, or an entity permitted under the Good Governance rules, you verify Aadhaar offline with the holder's signed XML or QR, not through online authentication.
  • DigiLocker issued documents carry legal parity; uploaded ones do not. Treat the two as different trust levels in your data model.
  • Consent is a record with a scope, a purpose and an expiry. UIDAI, DigiLocker and the Account Aggregator framework all require it; the DPDP Act now requires it generally.
  • Every path yields evidence, not just a result. Signed XML, an issuer-signed document, a signed consent artefact: keep the artefact that proves what you verified, never only the boolean.

Aadhaar: Modes, Roles and Rules

Authentication modes (Aadhaar Authentication API and e-KYC API; check UIDAI's developer section for the current version)

  • Demographic: name, date of birth, gender, address matched against the CIDR.
  • OTP: one-time password to the registered mobile or email; yes/no result.
  • Biometric: fingerprint, iris or face captured on a UIDAI-registered device through its RD Service and encrypted at the sensor, or face captured through UIDAI's face authentication SDK; yes/no result.
  • Multi-factor: combinations of the above.
  • e-KYC: returns demographic data and photo, digitally signed by UIDAI, after one of the above factors; available only to KUAs.

Roles: an Authentication User Agency (AUA) and KYC User Agency (KUA) contract directly with UIDAI; Sub-AUAs ride on an AUA's licence; an Authentication Service Agency (ASA) provides the secure network leg to the CIDR. Since 2018 authentication responses carry an agency-specific UID token in place of the Aadhaar number, so an AUA cannot correlate a user across agencies.

Virtual ID (VID): a 16-digit revocable number the holder generates on the myAadhaar portal; accept VID wherever you accept Aadhaar so the holder need not disclose the number.

What the law allows

  • Core biometric information is never shared or stored by anyone other than UIDAI (Section 29).
  • No entity may publish, display or post an Aadhaar number publicly (Section 29(4)); printed forms and screens show the masked form (first eight digits hidden).
  • The 2018 judgment struck down the part of Section 57 that let private entities use authentication by contract. The 2019 amendment permits voluntary Aadhaar authentication for bank account opening under the Prevention of Money-laundering Act and for telecom subscriptions, and introduced offline verification (Section 8A) that any entity may use with the holder's consent.
  • Government-notified purposes under the Aadhaar Authentication for Good Governance rules can extend online authentication to other entities through a sponsoring ministry; check the current process with UIDAI.
  • UIDAI requires every entity that stores Aadhaar numbers to keep them in an Aadhaar Data Vault: a segregated, encrypted store keyed by a reference number that the rest of your systems use in place of the Aadhaar number, with keys in a hardware security module. Masked Aadhaar and reference keys may live outside the vault; the full number may not.
  • Documents collected as identity proof that show an Aadhaar number must be masked before storage.
  • Unauthorised use, disclosure or storage carries penalties under Chapter VII of the Act; UIDAI can also suspend or blacklist an AUA.

Choosing a Verification Path

PathWho may use itWhat you receiveTypical use
Online OTP or biometric authenticationAUA or sub-AUA with a lawful basisYes/no plus UID tokenAttendance, benefit delivery, bank operations
e-KYC through a KUABanks and regulated entities under PMLA; notified purposesUIDAI-signed demographics and photoBank account opening, full-KYC wallets, telecom
Aadhaar Paperless Offline e-KYC (ZIP with XML)Any entity, with consentUIDAI-signed XML, reference id, hashed mobile and emailLenders, marketplaces, employers, landlords
Secure QR on the Aadhaar letter or PVC cardAny entitySigned demographics and photoField verification, physical card
e-Aadhaar XML via DigiLocker requester scopeAny registered requester, with consente-Aadhaar XMLApp onboarding, video KYC
Visual check of a printed AadhaarAnyoneNothing machine-verifiableNever as sole KYC

Offline Paperless e-KYC and the Secure QR

The holder downloads a password-protected ZIP from the myAadhaar portal containing an XML signed by UIDAI and chooses a four-digit share code that is the ZIP password. The XML carries a reference id (last four digits of the Aadhaar plus a timestamp), name, date of birth, gender, address fields, a base64 photo, and hashed mobile and email. The mobile and email hashes are SHA-256 over the value concatenated with the share code, iterated according to the last digit of the Aadhaar number as specified in UIDAI's offline e-KYC document (with 0 and 1 treated as a single iteration in the published rule), which lets you verify a mobile number the holder tells you without receiving it from UIDAI.

Verification steps

  1. Accept the ZIP and share code from the holder; open it in memory, never on disk.
  2. Verify the XML signature against UIDAI's published public certificate; reject on failure or on an unknown certificate.
  3. Check the timestamp inside the reference id against your freshness policy (many lenders accept a limited window; the RBI KYC Master Direction says what a regulated entity may accept).
  4. Match the name and date of birth against what the holder typed; compare the photo with a live selfie where your risk policy requires.
  5. Verify the mobile hash against the number you will use for OTP.
  6. Store the masked reference, the demographic fields you need and the signed XML for audit; do not derive or store the full Aadhaar number.

The secure QR printed on the Aadhaar letter, PVC card and e-Aadhaar contains signed demographic data and photo and can be read offline with UIDAI's published decoder; it is a second offline verification path when the holder has only a physical card.

DigiLocker

DigiLocker is operated by the National e-Governance Division under MeitY. Under the Information Technology rules for digital-locker intermediaries, documents issued into a citizen's locker by a registered issuer have the same legal status as the originals.

  • Issued documents are pulled from the issuer's system at request time via a document URI (issuer id, document type, identifier) and come with the issuer's signature: PAN verification record, driving licence and vehicle registration, e-Aadhaar XML fetched from UIDAI, board and university certificates, insurance policies, and others listed in the issuer directory.
  • Uploaded documents are files the citizen added; they may be e-signed by the citizen but carry no issuer verification. Do not treat them as KYC.
  • Issuer integration: organisations that issue documents (an insurer, a university, a certification body) register as issuers and expose a pull API that DigiLocker calls with the identifier.
  • Regulated KYC: the RBI KYC Master Direction treats documents obtained from DigiLocker as equivalent e-documents for customer due diligence; V-CIP flows commonly begin with an e-Aadhaar XML from DigiLocker or Offline e-KYC. Check the Master Direction for the current wording.
  • Entity Locker extends the model to organisations' documents; check its availability for your use case.

Requester integration, step by step

  1. Register as a partner on the DigiLocker partner portal, describe the purpose, and receive client credentials for a sandbox and later production.
  2. Send the citizen to DigiLocker's OAuth 2.0 authorisation endpoint with the scopes for the document types you need; the citizen signs in (Aadhaar or mobile with OTP) and sees the consent screen naming your organisation and the documents.
  3. Exchange the authorisation code for an access token at the token endpoint; the token is scoped to that consent and expires.
  4. List the citizen's issued documents, fetch each needed document by URI as PDF or XML, and, if consented, fetch the e-Aadhaar XML.
  5. Verify the issuer's signature on each document; store the document, its URI, the fetch timestamp and the consent reference.
  6. Refresh consent when the token expires; never cache a token to fetch new documents later without the citizen present.

Account Aggregator Framework

Account Aggregators are NBFCs licensed by RBI under the NBFC-AA Master Direction to route financial information from Financial Information Providers (FIPs: banks, insurers, mutual-fund registrars, GSTN) to Financial Information Users (FIUs: lenders, wealth managers) with the customer's electronic consent. The technical standards are published by ReBIT; the ecosystem body is Sahamati. The AA never sees the data in the clear: FIP and FIU perform a Diffie-Hellman key exchange per session and the FIP encrypts the payload for the FIU.

Consent artefact (the electronic consent per the DEPA framework): purpose code and text, FI types requested (for example DEPOSIT, TERM_DEPOSIT, RECURRING_DEPOSIT, MUTUAL_FUNDS, INSURANCE_POLICIES, GSTR1_3B), consent types (PROFILE, SUMMARY, TRANSACTIONS), consent mode (VIEW, STORE, QUERY, STREAM), fetch type (ONETIME or PERIODIC) with frequency, data range, data life (how long the FIU may retain), consent start and expiry, and the FIU and customer identifiers. The customer approves in the AA's app or web handle and can revoke at any time.

Flow for an FIU

  1. Register with an AA and with Sahamati's central registry; obtain client credentials and signing keys.
  2. Create a consent request (/Consent per the ReBIT specification) with the artefact parameters; redirect or deep-link the customer to the AA with the consent handle.
  3. Receive the consent notification with the consent id and the signed artefact; verify the signature.
  4. Request data (/FI/request) with your session key material; receive a session id.
  5. On the data-ready notification, fetch (/FI/fetch), derive the shared secret from the FIP's key material, decrypt, and validate the FI schema for each account.
  6. Apply the data-life rule: purge on expiry; log every access for the customer's review.
  7. Monitor the AA's /Heartbeat and FIP coverage; not every bank supports every FI type at the same quality, and you need a fallback (bank statement upload with password removal) for gaps.

Consent, Logging and Retention

  • Record who consented, to what, when, through which channel, and the notice version, in the same ledger the DPDP skill describes; Aadhaar, DigiLocker and AA consents are specific instances of it.
  • Log every authentication, fetch and detokenisation with purpose and actor; UIDAI audits AUAs on these logs and the DPDP Act gives the principal a right to see them in summary.
  • Retain the signed artefacts for the period your regulator sets and delete the rest on schedule; the AA data life and DigiLocker consent scope are hard limits, not suggestions.
  • Give the user a page listing which identity sources you used and when.

Worked Example: Aadhaar Data Vault Reference Model

-- Vault (separate database, separate network segment, HSM-managed key)
CREATE TABLE aadhaar_vault (
  ref_key      CHAR(36) PRIMARY KEY,   -- UUID handed to application systems
  aadhaar_enc  BYTEA NOT NULL,         -- AES-256-GCM ciphertext, key in HSM
  created_at   TIMESTAMPTZ NOT NULL
);

-- Application schema (never holds the number)
CREATE TABLE customer_identity (
  customer_id     BIGINT PRIMARY KEY,
  aadhaar_ref     CHAR(36) NULL,       -- points into the vault, only when lawfully held
  aadhaar_masked  CHAR(14) NULL,       -- 'XXXX-XXXX-1234'
  kyc_mode        TEXT NOT NULL,       -- 'OFFLINE_XML' | 'DIGILOCKER' | 'EKYC_KUA' | 'VCIP'
  kyc_reference   TEXT NOT NULL,       -- offline reference id or DigiLocker URI
  consent_id      TEXT NOT NULL,       -- row in the consent ledger
  verified_at     TIMESTAMPTZ NOT NULL
);

Application code calls the vault over an authenticated internal API to tokenise or, for the few lawful purposes, detokenise; every detokenisation is logged with purpose and actor.

Worked Example: Offline XML Mobile-Hash Check

import hashlib

def aadhaar_mobile_hash(mobile: str, share_code: str, last_digit: int) -> str:
    rounds = 1 if last_digit in (0, 1) else last_digit
    value = (mobile + share_code).encode()
    for _ in range(rounds):
        value = hashlib.sha256(value).hexdigest().encode()
    return value.decode()

The last digit comes from the reference id's leading four digits, which are the last four digits of the Aadhaar number. Compare the result with the m attribute in the XML, and confirm the iteration rule against UIDAI's current offline e-KYC specification before relying on it.

Worked Example: Account Aggregator Consent Parameters

{
  "purpose": { "code": "105", "text": "Explicit one-time consent for the accounts" },
  "fiTypes": ["DEPOSIT"],
  "consentTypes": ["TRANSACTIONS", "PROFILE", "SUMMARY"],
  "consentMode": "STORE",
  "fetchType": "ONETIME",
  "dataRange": { "from": "2025-09-01T00:00:00.000Z", "to": "2026-09-01T00:00:00.000Z" },
  "dataLife": { "unit": "MONTH", "value": 3 },
  "consentExpiry": "2026-10-01T00:00:00.000Z"
}

Purpose codes and their text come from the ReBIT purpose-code list, and the text must match the code (in that list code 101 is wealth management, 103 an aggregated statement and 105 an explicit one-time consent for the accounts, which is the usual choice for a one-off underwriting pull); confirm the code against the current list published through Sahamati before going live. Ask for the narrowest FI types, the shortest data range and the shortest data life that the decision actually needs.

Checklists

Before integrating Aadhaar authentication

  • Legal basis identified: bank or regulated entity under PMLA; Good Governance notification; or offline verification only
  • AUA or KUA agreement, sub-AUA onboarding, ASA connectivity and UIDAI audit requirements understood
  • Aadhaar Data Vault provisioned with HSM-managed keys; application code has no path to the raw number
  • Masking applied on every screen, printout, log and document scan
  • Consent screen states purpose, what is fetched and retention; consent record stored with timestamp
  • VID accepted everywhere an Aadhaar number is accepted
  • Registered biometric devices and RD Service versions tracked if biometric modes are used

DigiLocker and Account Aggregator

  • Requester scopes limited to the documents you need; issued versus uploaded distinguished in the data model
  • Signature verification on every issued document and on every consent artefact
  • Data-life and consent-expiry purges scheduled and tested
  • Customer-facing view of which documents and accounts were accessed and when
  • Fallback path when an FIP is down or a document type is not yet issued to DigiLocker

Common Mistakes

  • Using OTP authentication through a borrowed sub-AUA for a purpose the entity is not permitted to authenticate for.
  • Storing the Aadhaar number in the customer table "temporarily" and never vaulting it.
  • Accepting an Offline e-KYC XML without verifying the UIDAI signature or its age.
  • Treating a DigiLocker uploaded document as proof of identity.
  • Logging full Aadhaar numbers, XML contents or AA payloads in application logs or error trackers.
  • Retaining Account Aggregator data past the data-life in the consent because a model "needs history."
  • Printing the full Aadhaar number on invoices, ID cards or contracts.
  • Reusing a DigiLocker access token after the session to fetch documents the citizen never saw you fetch.
  • Building the funnel around Aadhaar as mandatory when the user has a lawful right to use another officially valid document.

Limits and When Not to Use This

This skill describes the mechanism of Aadhaar authentication and offline verification as published by UIDAI, DigiLocker's issuer and requester model under MeitY, and the Account Aggregator framework under RBI and ReBIT. API versions, permitted purposes, freshness windows and onboarding processes change; verify against UIDAI's current regulations and developer documentation, the DigiLocker partner documentation, the RBI KYC Master Direction and the ReBIT specification. It does not cover becoming an AUA, KUA, ASA, AA or FIP, or the UIDAI audit process, in depth. This is not legal advice: whether your entity may perform Aadhaar authentication at all, and on what basis, is a question for a lawyer experienced in the Aadhaar Act and the DPDP Act; for regulated KYC obligations consult a compliance professional familiar with the RBI KYC Master Direction.

Install this skill directly: skilldb add india-business-tech-skills

Get CLI access →

Related Skills

DPDP Act Compliance

Activate this skill when the user is making a product or organisation compliant with the Digital Personal Data Protection Act, 2023 and the DPDP Rules in India: designing consent and notice flows, deciding when a legitimate use applies instead of consent, integrating with a Consent Manager, meeting Data Fiduciary and Significant Data Fiduciary obligations, handling children's data with verifiable parental consent, reporting personal data breaches to the Data Protection Board and affected users, or reviewing cross-border transfers. Triggers on "DPDP," "DPDP Act," "DPDP Rules," "Data Fiduciary," "Data Principal," "Significant Data Fiduciary," "Consent Manager," "Data Protection Board," "verifiable parental consent," "data breach notification India," "data localisation," or "privacy notice India." Relates to Aadhaar handling, RBI data rules and UPI or GST data retention.

India Business Tech174L

GST and E-Invoicing

Activate this skill when the user is implementing Goods and Services Tax for a business in India: computing CGST, SGST and IGST on invoices, registering for a GSTIN, mapping products to HSN or SAC codes, filing GSTR-1 and GSTR-3B, generating e-invoices with an IRN through an Invoice Registration Portal, creating e-way bills, or claiming input tax credit. Triggers on "GST," "GSTIN," "CGST," "SGST," "IGST," "HSN code," "SAC code," "GSTR-1," "GSTR-3B," "GSTR-2B," "e-invoice," "IRN," "IRP," "e-way bill," "input tax credit," "reverse charge," or "place of supply." Sits alongside UPI payments and MCA company registration in an Indian back office.

India Business Tech151L

Indian Payroll Compliance

Activate this skill when the user is running or building payroll for employees in India: computing Provident Fund and ESI contributions, deducting state professional tax, withholding TDS on salary under Section 192 and issuing Form 16, accruing gratuity and statutory bonus, taxing leave encashment, or planning a monthly and annual compliance calendar. Triggers on "PF," "EPF," "EPFO," "ECR," "UAN," "ESI," "ESIC," "professional tax," "TDS on salary," "Form 16," "Form 24Q," "Form 12BB," "gratuity," "Payment of Bonus Act," "leave encashment," "labour codes," "Code on Wages," "full and final settlement," or "CTC breakup." Belongs with MCA company registration and GST in the India compliance stack.

India Business Tech205L

Indic Localization

Activate this skill when the user is localising a product for India beyond English: adding Hindi and regional languages such as Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, Malayalam, Punjabi, Odia or Urdu; rendering Devanagari and other Brahmic scripts correctly; handling transliteration and romanised input; formatting numbers in lakh and crore, rupees and Indian dates; sizing UI for script expansion; choosing fonts; or reviewing with native speakers. Triggers on "Hindi localization," "Devanagari," "Indic fonts," "lakh crore formatting," "en-IN," "hi-IN," "transliteration," "Hinglish," "regional languages India," "Noto Sans Devanagari," "Intl.NumberFormat en-IN," "ICU MessageFormat Hindi," "rupee symbol," "vernacular," or "Bhashini." Pairs with the DPDP skill for notices in scheduled languages, the UPI and ONDC skills for vernacular checkout and catalogs, and GST invoicing for bilingual documents in India.

India Business Tech180L

MCA Company Registration

Activate this skill when the user is incorporating or maintaining a company in India through the Ministry of Corporate Affairs: choosing between a Private Limited company, an LLP and a One Person Company, filing SPICe+ on the MCA portal, obtaining Director Identification Numbers and Digital Signature Certificates, reserving a name, meeting ROC annual filing deadlines, or applying for DPIIT startup recognition. Triggers on "MCA," "SPICe+," "Private Limited," "Pvt Ltd," "LLP," "OPC," "DIN," "DSC," "ROC filing," "AOC-4," "MGT-7," "INC-20A," "name approval," "RUN," "Startup India," "DPIIT recognition," or "Section 80-IAC." Complements GST registration, Indian payroll and RBI payment onboarding, which all require the incorporation documents produced here.

India Business Tech171L

ONDC Integration

Activate this skill when the user is joining or building on the Open Network for Digital Commerce in India: deciding whether to be a buyer app, seller app or logistics provider, implementing the Beckn protocol API pairs, subscribing to the ONDC registry and passing site verification, signing requests with Ed25519, publishing a catalog, handling search, select, init, confirm, status, cancel and update flows, integrating logistics, or reconciling and settling with counterparties. Triggers on "ONDC," "Beckn," "buyer app," "seller app," "BAP," "BPP," "on_search," "on_confirm," "ONDC registry," "subscriber_id," "ondc-site-verification," "RSF," "settlement window," "buyer app finder fee," "IGM," or "network participant." Sits with UPI, GST e-invoicing and the DPDP skill in an Indian commerce stack.

India Business Tech150L