Vistarkriya
VistarKriya
api-integration

Aadhaar eKYC API Integration Guide: OKYC vs Offline KYC Methods

Complete guide to Aadhaar verification API integration. Learn about eKYC, OKYC, Offline KYC methods and how to implement them in your application.

V
Vistarkriya
โ€ข Apr 4, 2026 โ€ข 14 min read โ€ข 35 views
Share
Listen Ready
0:00 / 14:00
Aadhaar eKYC API Integration

Aadhaar eKYC (Electronic Know Your Customer) allows businesses to verify customer identity instantly using their Aadhaar number. This guide covers all Aadhaar verification methods and how to integrate them into your application.

Types of Aadhaar Verification

There are three main methods to verify Aadhaar:

OTP

Aadhaar eKYC (OTP)

Real-time verification using OTP sent to Aadhaar-linked mobile number.

  • Requires customer OTP
  • Returns full KYC data
  • Photo, address, DOB
  • UIDAI authentication
XML

Offline KYC (XML)

Customer downloads XML from UIDAI and shares with you.

  • No OTP needed
  • Customer-initiated
  • Masked Aadhaar (last 4 digits)
  • Valid for 3 days
QR

OKYC (QR Based)

Scan QR code from physical Aadhaar card or downloaded PDF.

  • No OTP needed
  • Instant verification
  • Limited data (no photo)
  • Signed by UIDAI

Aadhaar eKYC API Flow

Here is the step-by-step flow for OTP-based Aadhaar eKYC:

1
Send OTP Request - Submit Aadhaar number to generate OTP
2
Customer Receives OTP - 6-digit OTP sent to Aadhaar-linked mobile
3
Submit OTP - Verify OTP with transaction ID
4
Receive KYC Data - Get verified name, address, DOB, photo

API Integration Code Examples

Step 1: Generate OTP

POST /api/v1/aadhaar/generate-otp
Content-Type: application/json

{
  "aadhaar_number": "XXXX XXXX 1234",
  "consent": true,
  "reason": "KYC verification for loan application"
}

Response:
{
  "success": true,
  "transaction_id": "TXN-ABC123456",
  "message": "OTP sent to registered mobile"
}

Step 2: Verify OTP and Get KYC

POST /api/v1/aadhaar/verify-otp
Content-Type: application/json

{
  "transaction_id": "TXN-ABC123456",
  "otp": "123456"
}

Response:
{
  "success": true,
  "data": {
    "name": "Rajesh Kumar",
    "dob": "1990-05-15",
    "gender": "M",
    "address": {
      "house": "123",
      "street": "MG Road",
      "locality": "Koramangala",
      "city": "Bangalore",
      "state": "Karnataka",
      "pincode": "560034"
    },
    "photo": "base64_encoded_image",
    "masked_aadhaar": "XXXX XXXX 1234"
  }
}

Offline Aadhaar XML Verification

For cases where OTP is not feasible, use Offline KYC:

  1. Customer downloads XML from resident.uidai.gov.in
  2. Customer sets a share code (4-digit PIN)
  3. Customer shares XML file and share code with you
  4. Your system decrypts and verifies the XML
POST /api/v1/aadhaar/verify-xml
Content-Type: multipart/form-data

{
  "xml_file": [uploaded_xml],
  "share_code": "1234"
}

Response:
{
  "success": true,
  "data": {
    "name": "Rajesh Kumar",
    "dob": "1990-05-15",
    "gender": "M",
    "address": "123, MG Road, Koramangala, Bangalore - 560034",
    "masked_aadhaar": "XXXX XXXX 1234",
    "xml_generated_on": "2024-01-15",
    "signature_valid": true
  }
}

OKYC - QR Code Verification

The QR code on Aadhaar card contains digitally signed data:

POST /api/v1/aadhaar/verify-qr
Content-Type: application/json

{
  "qr_data": "scanned_qr_code_string"
}

Response:
{
  "success": true,
  "data": {
    "name": "Rajesh Kumar",
    "dob": "1990-05-15",
    "gender": "M",
    "masked_aadhaar": "XXXX XXXX 1234",
    "signature_valid": true
  }
}

Comparison of Methods

Feature eKYC (OTP) Offline XML OKYC (QR)
OTP Required Yes No No
Photo Available Yes Yes No
Full Address Yes Yes Limited
Real-time Yes No Yes
Best For Online KYC Offline/Rural Quick verify

Compliance Requirements

When using Aadhaar for KYC, ensure compliance with:

  • Explicit Consent: Obtain clear consent before collecting Aadhaar
  • Purpose Limitation: Use Aadhaar data only for stated purpose
  • Data Security: Encrypt and securely store Aadhaar data
  • Audit Trail: Maintain logs of all Aadhaar verifications
  • UIDAI Guidelines: Follow latest UIDAI circulars and guidelines

Integrate Aadhaar Verification Today

Get API access for eKYC, Offline XML, and QR verification

Get API Access
Tags: aadhaar ekyc aadhaar api okyc api aadhaar verification kyc api india

Found this helpful? Share it with others.

Comments

Share your thoughts on this article.

No comments yet. Be the first to share your thoughts!

Leave a Comment

Your email won't be published.

By submitting, you agree to our Privacy Policy. Comments are moderated.

You might also like