SetuBot
/

to search

Introducing Setu API playground Check it out ↗

#Offline Aadhaar KYC integration

Setu’s web based solution can be used to complete a customer’s KYC with offline Aadhaar—within your own app or website, in real-time. Offline Aadhaar involves getting a downloadable, locked XML file with Aadhaar information from your customers.

Essentially, only 2 APIs are required for enabling this flow—

  • Create OKYC request—Create OKYC request for your customer. You will get a unique id in the response which can be used to track this particular request.
    • Post this, the customer should be redirected to Setu’s UI for collection of details like Aadhaar number and share code for the locked XML file.
  • Get OKYC request status—Get status of customer verification by providing the request id.

Additionally, here are the URLs you would need for these APIs—

  • Sandbox—https://dg-sandbox.setu.co
  • Production—https://dg.setu.co
  • Headers—Contact Setu for providing the credentials required to successfully call Setu APIs. This contains:
    • x-client-id
    • x-client-secret
    • x-product-instance-id

#Create OKYC request

Call this API to create a unique request to get your customer started on the OKYC journey.

Setu’s pre-built screens will handle the OKYC completion flow, but you need to give Setu a redirectURL—this is where we will redirect your customer, once the OKYC journey is complete. This is the only param needed to create a new OKYC request.


Your request has a valid redirectURL and Setu has processed your request successfully.

The button shown in the screen should have response.url as the link.


Request

Share a redirectURL to send your customers to, after the OKYC journey is completed by your customer, on Setu screens.

POST /api/okyc/
Content-Length: 46
{
"redirectURL": "https://setu.co/anything?anyotherkeys=cangohere"
}

Response

You will get a unique URL from Setu—OKYC details will be collected here—where you will have to redirect your customer.

{
"id": "7097e53a-ba29-48a2-983d-878433b4f33e", //unique request id for the OKYC request
"url": "https://dg-sandbox.setu.co/okyc/initiate/uuid", //this is where you will redirect your customers
"validUpto": "Wed, 23 Jun 2021 19:33:55 GMT", //the time till when the request id is valid
"status": "incomplete" //status against the request id
}

url is a Setu generated URL, that is unique to a particular request id. This is where you should redirect the customer to, to complete their KYC. You can generate a new url as many times as you want without additional charges.


#Completion of OKYC by customer

are used to collect OKYC details from your customer. The following details are collected, as shown in the sample screen flow below—

  • Aadhaar number —not saved/stored by Setu—which is used to fetch the corresponding XML file for the customer, after an OTP verification is done with Aadhaar linked mobile number.
  • Share code is a 4 digit pin set by the customer and serves as the password to unlock the contents of the XML file.

The screen on the left shows Setu’s UI. This is what your customers see when filling in details to complete their OKYC.

When OKYC is completed, Setu will redirect the customer to the redirectURL that you provided in the Create OKYC request API. Setu will append the share code provided by the customer, and the request id to the provided URL. You should store both these values on your system to access the XML file at a later stage.


#Get OKYC request status

Call this API to view status of an OKYC journey that you initiated with a customer.

You can call this API whenever you need to check for the status associated with a particular request id.


Possible values for status, received as part of the response—

  • When complete, KYC is complete for a customer. If you provide a shareCode in the API request, you will get all customer details from the Aadhaar XML file.
  • When incomplete, you can check for KYC completion after some time.
  • In case the request has expired, your will get a 404 error code.

Your request has a valid OKYC request id and 4-digit shareCode.


Request
GET /api/okyc/:requestId/:shareCode/

Response

When status is complete, you will get all customer KYC details included in the XML, and the URL for the zip file.

{
"aadhaar": {
"address": {
"careOf": "S/O: Gurjar Pradeep",
"country": "India",
"district": "Bangalore",
"house": "# 90 1 Cross",
"landmark": "Near Talkies",
"locality": "Nagarabhavi",
"pin": "560072",
"postOffice": "Nagarbhavi",
"state": "Karnataka",
"street": "Nagarbhavi 1st Main Road",
"subDistrict": "Bangalore North",
"vtc": "Bangalore North"
},
"dateOfBirth": "23-05-1990",
"email": "550fa5fd91eee3f29f6361a8c89aa9713d4d38811d1a5",
"gender": "M",
"generatedAt": "20210419145604802",
"maskedNumber": "xxxx-xxxx-8832",
"name": "Jignesh Gurjar",
"phone": "09c91184c1d610282d661dd63d257e3b44446853fb1388c9d5b",
"photo": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKD==",
"verified": {
"email": false,
"phone": false,
"signature": true
},
"xml": {
"fileUrl": "https://dg-esign-uat.s3.amazonaws.com/testFolder/sample.zip",
"shareCode": "1111",
"validUntil": "Tue, 27 Jul 2021 12:16:27 GMT"
}
},
"status": "complete",
"id": "7097e53a-ba29-48a2-983d-878433b4f33e"
}

Was this page helpful?