Aadhaar eKYC API Integration Guide: OKYC vs Offline KYC Methods
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:
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
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
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:
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:
- Customer downloads XML from resident.uidai.gov.in
- Customer sets a share code (4-digit PIN)
- Customer shares XML file and share code with you
- 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
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 AccessRelated APIs
Originally published at: Aadhaar eKYC API Integration Guide: OKYC vs Offline KYC Methods
Comments
Post a Comment