Integration Flow - Verify Against Aadhaar Database

Learn about the API you need to integrate with to use ZWITCH's to verify an individual's photo against their photo in the Aadhaar database.

With ZWITH, you can verify an individual's photo against their photo in the Aadhaar database in 3 steps.

540

Photo Verification Against Aadhaar

  1. Verify Aadhaar
  2. Upload Photo
  3. Verify Photo

1. Verify Aadhaar

First, you need to verify the individual's Aadhaar. You need to verify the individual's Aadhaar since the individual's consent is required to download their details from the Aadhaar database.

Learn more about our Aadhaar Verification APIs.

Follow the below steps to verify an individual's Aadhaar.

  1. Send OTP
  2. Download Aadhaar Details

1.1. Send OTP

The Aadhaar holder's consent is required to download their details from the Aadhaar database. Here, consent is provided in the form of an OTP.

Use the below endpoint to send an OTP to the mobile number linked to the Aadhaar you want to verify.

POST: https://api.zwitch.io/v1/kycs/aadhaar/otp

Below is a sample request and response for the Send OTP API.

{
  "aadhaar_number": "300000000000",
  "name": "Anil Reddy",
  "merchant_reference_id": "1000921"
}
{
  "id": "adh_ZJr1DD9uZt59qq5oRpcenNqi3",
  "object": "aadhaar_verification",
  "aadhaar_number": "XXXXXXXX0000",
  "name": "Anil Reddy",
  "message": "OTP sent to registered mobile number",
  "status": "success",
  "remark": null,
  "merchant_reference_id": "1000921",
  "created_at": 1654253396,
  "is_sandbox": true
}

1.2. Download Aadhaar Details

The Aadhaar holder sends you the OTP they received. Use this OTP to download the Aadhaar holder's details from the Aadhaar database.

Use the below endpoint to download the Aadhaar details.

POST: https://api.zwitch.io/v1/kycs/aadhaar/{aadhaar_id}/verify

Below is a sample request and response for the Download Aadhaar Details API.

{
  "otp": "000000"
}
{
  "id": "adh_ZJr1DD9uZt59qq5oRpcenNqi3",
  "object": "aadhaar_verification",
  "message": "Aadhaar XML file downloaded successfully",
  "status": "success",
  "name": "Anil Reddy",
  "aadhaar_number": "XXXXXXXX0000",
  "date_of_birth": "1980-12-31",
  "gender": "M",
  "father_name": "Sunil Reddy",
  "address": "221B Baker Street",
  "postal_code": "560005",
  "state": "Karnataka",
  "state_code": "KA",
  "city": "bangalore urban",
  "remark": null,
  "merchant_reference_id": "1000921",
  "is_sandbox": true
}

2. Upload Photo

After verifying the individual's Aadhaar, you need to upload their photo to our server. This photo will be compared to the photo in the Aadhaar database.

Use the below endpoint to upload the required documents.

POST: https://api.zwitch.io/v1/documents

Below is a sample request and response for the Upload Document API.

curl --location --request POST 'https://api.zwitch.io/v1/documents' \
--header 'Authorization: Bearer <Access_Key>:<Secret_Key>' \
-- header 'Content-Type: multipart/form-data' \
--form 'file=@"/Users/your_name/sample_uploaded.png"' \
--form 'type="customer_photo"'
{
  "id": "doc_hYShM7oGLNRQoxyCh6ETd4Og7",
  "object": "document",
  "name": "doc_hYShM7oGLNRQoxyCh6ETd4Og7.png",
  "content_type": "image/png",
  "type": "customer_photo",
  "size": 22004,
  "customer_accessible": true,
  "created_at": 1654255503,
  "is_sandbox": true
}

Learn more about our Document Upload API.

3. Verify Photo

After verifying an individual's Aadhaar and uploading their photo, you can verify the uploaded photo against their photo in the Aadhaar database.

Use the below endpoint to upload the required photo.

POST: https://api.zwitch.io/v1/kycs/photo-match

Below is a sample request and response for the Photo Verification API.

{
  "type": "aadhaar",
  "aadhaar_verification_id": "adh_SQMGqA448nF7VhzYhpnPt0qNl",
  "document_id": "doc_qsUwixnXwHI4tZLQnbf1xn2tQ",
  "minimum_match_score": 75,
  "metadata": {
    "key_1": "DD",
    "key_2": "XOF"
  }
}
{
  "id": "phm_mDJezeS7z3tBJzv5qlQOJIvWA",
  "object": "photo_match.aadhaar",
  "type": "aadhaar",
  "aadhaar_verification_id": "adh_SQMGqA448nF7VhzYhpnPt0qNl/",
  "document_id": "doc_qsUwixnXwHI4tZLQnbf1xn2tQ",
  "minimum_match_score": 75,
  "status": "success/failed",
  "match_score": 99.97,
  "review_needed": false,
  "metadata": {
    "key_1": "DD",
    "key_2": "XOF"
  },
  "created_at": 1656417101,
  "updated_at": 1656417101,
  "is_sandbox": true
}

Learn more about our Photo Verification API.