KYC-OCR API - v2.3 - 14052025
KYC-OCR API - v2.3 - 14052025
ai DIGI-OCR (KYC)
API Doc & Integration Guide
(Version 2.3, 14th May, 2025)
1. Introduction 2
1
1. Introduction
This document is intended for our enterprise partners who can easily integrate the services they
have chosen with Digitap.ai. Using this document they can jumpstart their business processes
and start using the Digitap.ai services as early as possible and also align their own business
processes seamlessly by integrating and making changes to their backend.
Digitap.ai DIGI-OCR service is an AI-driven application for document-specific extraction. With
Digi-OCR, one can accurately extract details from various KYC/Identity documents. This
document describes the DIGI-OCR APIs in detail.
Note: Digitap.ai reserves the right to modify this SDK integration guide from time-to-time. If you
are a business using this SDK integration guide, you will be notified well in advance, prior to any
change being made.
2.1 Authentication
To use Digitap OCR API, one needs to register with Digitap and get a client id & client secret
key. The client ID & secret key are different for the UAT & production environment.
2.2 URLs
Following is the base URL for UAT & production Environment.
Following is the URL for extracting data from specific KYC Doc Image:
2
<base_url>/ocr/v1/aadhaar For Extracting Aadhaar card data
● Header:
3
Note: client_id and client_secret are separated by
“:”(Colon) and the entire string with the colon
needs to be Base64 encoded.
● Request Body:
clientRefId M Unique ID for the OCR request from the Client side
[Max of 45 chars]
isBlackWhiteCheck$ O If set to “yes”, API will check for image color and
output the result under the key “isBlackWhite”
field of “qualityCheck”. API will set isBlackWhite
to yes for black and white images and no if the
image is coloured.
4
For voter and passport, the value will be set as
“NA”.
{
"status": "success",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 200,
"result": [ < resultObject1 > , < resultObject2 > , ..]
}
5
{
"type": "kyc_type",
"details": {
"field-1": {
"value": "< extracted value >",
"conf": "< confidence score of the extracted field >"(optional)
},
"field-2": {
"value": "< extracted value >"
"conf": "< confidence score of the extracted field >"(optional)
} ...
}
}
○ “kyc_type” is one of the doc types defined in the different kyc_type Types and
their fields.
○ field dict contains the extracted value in the “value” key and confidence of the
extracted field in the “conf” key(if input parameter is set to yes). Apart from the
value, it may contain additional data (For e.g., for Aadhaar fields, there can be
“is_masked”). Please refer to individual responses for details in the success
response details schema.
{
"status": "failure",
"statusCode": 401,
"result": null,
"error": "Unauthorized",
"clientRefId": "",
"ocrReqId": ""
}
● HTTP status code 400 is returned in the case of Bad Input Request:
○ Missing mandatory parameters or incorrect base64 encoded format <400>
{
"status": "failure",
"statusCode": 400,
"result": null,
"error": "Bad Request",
"clientRefId": "",
"ocrReqId": ""
}
6
○ Invalid PDF password/No Password provided for Protected PDF <400>
{
"status": "failure",
"statusCode": 400,
"result": null,
"error": "Invalid PDF password or No Password Provided",
"clientRefId": "nnn",
"ocrReqId": "xxxx"
}
● HTTP Status Code 500 is returned for request errors. The following are the request
errors possible:
○ No image/PDF Input
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 500,
"result": null,
"error": "API call requires one input image"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 500,
"result": null,
"error": "API call handles only one input image"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 500,
"result": null,
"error": "Not a valid Image/PDF"
}
7
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 500,
"result": null,
"error": "Size exceeds limit" <image size cannot be greater than 6Mb or
dimensions 4200x4200>
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 500,
"result": null,
"error": "Multiple pages in PDF not supported”
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 500,
"result": null,
"error": "Internal server error”
}
● HTTP Status Code 501 is returned when KYC document is not detected from an image
or when multiple KYC of the same type is detected:
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "No Pancard detected"
}
8
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "Multiple Pancard detected"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "No Aadhaar detected"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "Multiple Aadhaar detected"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "No VoterID detected"
}
9
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "Multiple VoterID detected"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "No Passport detected"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 501,
"result": null,
"error": "Multiple Passport detected"
}
● HTTP Status Code 503 is returned when the text in the input file is not visible:
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 503,
"result": null,
"error": "Error in Pan OCR engine"
}
10
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 503,
"result": null,
"error": "Error in Aadhaar OCR engine"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 503,
"result": null,
"error": "Error in VoterID OCR engine"
}
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 503,
"result": null,
"error": "Error in Passport OCR engine"
}
● HTTP Status Code 504 is returned when API gateway timeout happens:
{
"message": "Endpoint request timed out"
}
● HTTP Status Code 505 is returned when logging error happens<INTERNAL SERVER
ERROR>:
{
"status": "failure",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 505,
"result": null,
11
"error": "Failed to record response"
}
12
4.1 PAN
● type: pan OR old_pan(for PAN format 1972)
"name": {
"value": <type: String, description: holder’s Name>
},
"father": {
"value": <type: String, description: holder’s Father's name>
},
"date": {
"value": <type: String, description: holder’s date of birth>
},
"pan_no": {
"value": <type: String, description: holder’s PAN Number>
},
"qualityCheck": {
"isBlackWhite": <type: String, description: no if the image is coloured else will return yes for black
and white images>,
"isCompleteImage": <type: String, description: no if the image is not complete else will return yes
for complete images>
},
"fraudCheck": {
"result": <type: bool, description: true if the PAN is a fraudulent document>
"remarks": <type: String, description: reason for PAN to be a fraudulent document>
"details": <detailsObject>
}
4.2 AADHAAR
● type: aadhaar_front_bottom
"dob": {
"value": <type: String, description: holder’s Date of Birth>
},
"gender": {
"value": <type: String, description: holder’s Gender>
},
"yob": {
"value": <type: String, description: holder’s Year of Birth>
},
"mother": {
"value": <type: String, description: holder’s Mother's name>
},
"husband": {
"value": <type: String, description: holder’s Husband's name>
},
"phone": {
"value": <type: String, description: holder’s contact number>
},
"father": {
"value": <type: String, description: holder’s Father's name>
},
13
"qr": {
"value": <type: String, description: QR code XML extracted from the Input Aadhaar Image>
},
"barcode": {
"value": <type: String, description: Barcode number extracted from the Input Aadhaar Image>
},
"name": {
"value": <type: String, description: holder’s Name>
},
"aadhaar": {
"value": <type: String, description: holder’s Aadhaar Number>,
"ismasked": <type: String, values: [yes or no], description: yes if the Aadhaar number extracted is of
masked type and no if it is not of masked type>,
"verhoeffCheckPassed": <type: String, values: [yes or no] description: yes if the Aadhaar number
passes the Verhoeff Algorithm check else no>
},
"vid": {
"value": <type: String, description: holder’s VID number>
},
"maskedImageURL": {
"value": <type: String, description: 8 digits masked aadhar image public url>
},
"qualityCheck": {
"isBlackWhite": <type: String, description: no if the image is coloured else will return yes for black and
white images>
},
"fraudCheck": {
"result": <type: bool, description: true if the aadhaar front bottom is a fraudulent document>
"remarks": <type: String, description: reason for aadhaar front bottom to be a fraudulent document>
"details": <detailsObject>
}
● type: aadhaar_front_top
"phone": {
"value": <type: String, description: holder’s contact number>
},
"father": {
"value": <type: String, description: holder’s Father's name>
},
"qr": {
"value": <type: String, description: QR code XML extracted from the Input Aadhaar Image>
},
"barcode": {
"value": <type: String, description: Barcode number extracted from the Input Aadhaar Image>
},
"name": {
"value": <type: String, description: holder’s Name>
},
"aadhaar": {
"value": <type: String, description: holder’s Aadhaar Number>,
"ismasked": <type: String, values: [yes or no], description: yes if the Aadhaar number extracted is of
masked type and no if it is not of masked type>,
14
"verhoeffCheckPassed": <type: String, values: [yes or no] description: yes if the Aadhaar number
passes the Verhoeff Algorithm check else no>
},
"vid": {
"value": <type: String, description: holder’s VID number>
},
"husband": {
"value": <type: String, description: holder’s Husband's name>
},
"address": {
"house_number": <type: String, description: holder’s House number in address>,
"street": <type: String, description: holder’s Street in address>,
"locality": <type: String, description: holder’s Locality in address>,
"district": <type: String, description: holder’s District in address>,
"state": <type: String, description: holder’s State in address>,
"pin": <type: String, description: holder’s Pincode in address>,
"city": <type: String, description: holder’s City in address>,
"landmark": <type: String, description: holder’s Landmark in address>,
"line1": <type: String, description: holder’s Line1 in address>,
"line2": <type: String, description: holder’s Line2 in address>,
"care_of": <type: String, description: holder’s Guardian name in address>,
"value": <type: String, description: holder’s Address>
},
"pin": {
"value": <type: String, description: holder’s Pin Code in address>
},
"care_of": {
"value": <type: String, description: holder’s Mother's name>
},
"maskedImageURL": {
"value": <type: String, description: 8 digits masked aadhar image public url>
},
"fraudCheck": {
"result": <type: bool, description: true if the aadhaar front top is a fraudulent document>
"remarks": <type: String, description: reason for aadhaar front top to be a fraudulent document>
"details": <detailsObject>
}
● type: aadhaar_back
"father": {
"value": <type: String, description: holder’s Father's name>
},
"qr": {
"value": <type: String, description: QR code XML extracted from the Input Aadhaar Image>
},
"barcode": {
"value": <type: String, description: Barcode number extracted from the Input Aadhaar Image>
},
"aadhaar": {
"value": <type: String, description: holder’s Aadhaar Number>,
"ismasked": <type: String, values: [yes or no], description: yes if the Aadhaar number extracted is of
masked type and no if it is not of masked type>,
15
"verhoeffCheckPassed": <type: String, values: [yes or no] description: yes if the Aadhaar number
passes the Verhoeff Algorithm check else no>
},
"vid": {
"value": <type: String, description: holder’s VID number>
},
"husband": {
"value": <type: String, description: holder’s Husband's name>
},
"address": {
"house_number": <type: String, description: holder’s House number in address>,
"street": <type: String, description: holder’s Street in address>,
"locality": <type: String, description: holder’s Locality in address>,
"district": <type: String, description: holder’s District in address>,
"state": <type: String, description: holder’s State in address>,
"pin": <type: String, description: holder’s Pincode in address>,
"city": <type: String, description: holder’s City in address>,
"landmark": <type: String, description: holder’s Landmark in address>,
"line1": <type: String, description: holder’s Line1 in address>,
"line2": <type: String, description: holder’s Line2 in address>,
"care_of": <type: String, description: holder’s Guardian name in address>,
"value": <type: String, description: holder’s Address>
},
"pin": {
"value": <type: String, description: holder’s Pin Code in address>
},
"care_of": {
"value": <type: String, description: holder’s Mother's name>
},
"maskedImageURL": {
"value": <type: String, description: 8 digits masked aadhar image public url>
},
"qualityCheck": {
"isBlackWhite": <type: String, description: no if the image is coloured else will return yes for black and
white images>
},
"fraudCheck": {
"result": <type: bool, description: true if the aadhaar back is a fraudulent document>
"remarks": <type: String, description: reason for aadhaar back to be a fraudulent document>
"details": <detailsObject>
}
4.3 VOTER ID
● type: voterid_front_old
16
"voterid": {
"value": <type: String, description: holder’s VoterID>
},
"gender": {
"value": <type: String, description: holder’s Gender>
},
"relation": {
"value": <type: String, description: holder’s Relation’s name>
},
"name": {
"value": <type: String, description: holder’s Name>
},
"doc": {
"value": <type: String, description: Date for Age Calculation>
},
"age": {
"value": <type: String, description: holder’s Age>
},
"dob": {
"value": <type: String, description: holder’s Date of Birth>
},
"qualityCheck": {
"isBlackWhite": “NA”
},
"fraudCheck": {
"result": <type: bool, description: true if the voter back is a fraudulent document>
"remarks": <type: String, description: reason for voter back to be a fraudulent document>
"details": <detailsObject>
}
● type: voterid_front_new
"voterid": {
"value": <type: String, description: holder’s VoterID>
},
"relation": {
"value": <type: String, description: holder’s Relation’s name>
},
"name": {
"value": <type: String, description: holder’s Name>
},
"qualityCheck": {
"isBlackWhite": “NA”
},
"fraudCheck": {
"result": <type: bool, description: true if the voter front is a fraudulent document>
"remarks": <type: String, description: reason for voter front to be a fraudulent document>
"details": <detailsObject>
}
● type: voterid_pvc_front
17
"voterid": {
"value": <type: String, description: holder’s VoterID>
},
"relation": {
"value": <type: String, description: holder’s Relation’s name>
},
"name": {
"value": <type: String, description: holder’s Name>
},
"qualityCheck": {
"isBlackWhite": “NA”
},
"fraudCheck": {
"result": <type: bool, description: true if the voter front is a fraudulent document>
"remarks": <type: String, description: reason for voter front to be a fraudulent document>
"details": <detailsObject>
}
● type: voterid_back_old
"voterid": {
"value": <type: String, description: holder’s VoterID>
},
"issue_date": {
"value": <type: String, description:Date of Issue of VoterID>
},
"address": {
"house_number": <type: String, description: holder’s House number in address>,
"street": <type: String, description: holder’s Street in address>,
"locality": <type: String, description: holder’s Locality in address>,
"district": <type: String, description: holder’s District in address>,
"state": <type: String, description: holder’s State in address>,
"pin": <type: String, description: holder’s Pincode in address>,
"city": <type: String, description: holder’s City in address>,
"landmark": <type: String, description: holder’s Landmark in address>,
"line1": <type: String, description: holder’s Line1 in address>,
"line2": <type: String, description: holder’s Line2 in address>,
"value": <type: String, description: holder’s Address>
},
"pin": {
"value": <type: String, description: holder’s Pin Code in address>
},
"qualityCheck": {
"isBlackWhite": “NA”
},
"fraudCheck": {
"result": <type: bool, description: true if the voter back is a fraudulent document>
"remarks": <type: String, description: reason for voter back to be a fraudulent document>
"details": <detailsObject>
}
● type: voterid_back_new
18
"voterid": {
"value": <type: String, description: holder’s VoterID>
},
"gender": {
"value": <type: String, description: holder’s Gender>
},
"dob": {
"value": <type: String, description: holder’s Date of Birth>
},
"age": {
"value": <type: String, description: holder’s Age>
},
"issue_date": {
"value": <type: String, description:Date of Issue of VoterID>
},
"address": {
"house_number": <type: String, description: holder’s House number in address>,
"street": <type: String, description: holder’s Street in address>,
"locality": <type: String, description: holder’s Locality in address>,
"district": <type: String, description: holder’s District in address>,
"state": <type: String, description: holder’s State in address>,
"pin": <type: String, description: holder’s Pincode in address>,
"city": <type: String, description: holder’s City in address>,
"landmark": <type: String, description: holder’s Landmark in address>,
"line1": <type: String, description: holder’s Line1 in address>,
"line2": <type: String, description: holder’s Line2 in address>,
"value": <type: String, description: holder’s Address>
},
"pin": {
"value": <type: String, description: holder’s Pin Code in address>
},
"qualityCheck": {
"isBlackWhite": “NA”
},
"fraudCheck": {
"result": <type: bool, description: true if the voter front is a fraudulent document>
"remarks": <type: String, description: reason for voter front to be a fraudulent document>
"details": <detailsObject>
}
● type: voterid_pvc_back
"gender": {
"value": <type: String, description: holder’s Gender>
},
"dob": {
"value": <type: String, description: holder’s Date of Birth>
},
"age": {
"value": <type: String, description: holder’s Age>
},
"issue_date": {
"value": <type: String, description:Date of Issue of VoterID>
19
},
"address": {
"house_number": <type: String, description: holder’s House number in address>,
"street": <type: String, description: holder’s Street in address>,
"locality": <type: String, description: holder’s Locality in address>,
"district": <type: String, description: holder’s District in address>,
"state": <type: String, description: holder’s State in address>,
"pin": <type: String, description: holder’s Pincode in address>,
"city": <type: String, description: holder’s City in address>,
"landmark": <type: String, description: holder’s Landmark in address>,
"line1": <type: String, description: holder’s Line1 in address>,
"line2": <type: String, description: holder’s Line2 in address>,
"value": <type: String, description: holder’s Address>
},
"pin": {
"value": <type: String, description: holder’s Pin Code in address>
},
"qualityCheck": {
"isBlackWhite": “NA”
},
"fraudCheck": {
"result": <type: bool, description: true if the voter front is a fraudulent document>
"remarks": <type: String, description: reason for voter front to be a fraudulent document>
"details": <detailsObject>
}
4.4. PASSPORT
● type: passport_front
20
"country_code": {
"value": <type: String, description: Country Code of the holder's Passport>
},
"dob": {
"value": <type: String, description: Date of Birth of the holder>
},
"doe": {
"value": <type: String, description: Date of Expiry of the Passport>
},
"doi": {
"value": <type: String, description: Date of Issue of the Passport>
},
"gender": {
"value": <type: String, description: Gender of the holder>
},
"given_name": {
"value": <type: String, description: Given Name of the holder>
},
"nationality": {
"value": <type: String, description: Nationality of the holder>
},
"passport_num": {
"value": <type: String, description: Passport Number of the holder>
},
"place_of_birth": {
"value": <type: String, description: Place of birth of the holder>
},
"place_of_issue": {
"value": <type: String, description: Place of issue of the Passport>
},
"surname": {
"value": <type: String, description: Surname of the holder>
},
"type": {
"value": <type: String, description: Type of the passport>
},
"qualityCheck": {
"isBlackWhite": “NA”
},
"mrz": {
"line1": <type: String, description: Line 1 of MRZ in the Passport>,
"line2": <type: String, description: Line 2 of MRZ in the Passport>
}
● type: passport_back
21
"address": {
"house_number": <type: String, description: holder’s House number in address>,
"street": <type: String, description: holder’s Street in address>,
"locality": <type: String, description: holder’s Locality in address>,
"district": <type: String, description: holder’s District in address>,
"state": <type: String, description: holder’s State in address>,
"pin": <type: String, description: holder’s Pincode in address>,
"city": <type: String, description: holder’s City in address>,
"landmark": <type: String, description: holder’s Landmark in address>,
"line1": <type: String, description: holder’s Line1 in address>,
"line2": <type: String, description: holder’s Line2 in address>,
"value": <type: String, description: holder’s Address>
},
"father": {
"value": <type: String, description: Father's name of the holder>
},
"mother": {
"value": <type: String, description: Mother's name of the holder>
},
"file_num": {
"value": <type: String, description: File number of the Passport>
},
"old_doi": {
"value": <type: String, description: Date of Issue of the Old Passport>
},
"old_passport_num": {
"value": <type: String, description: Old Passport Number of the holder>
},
"old_place_of_issue": {
"value": <type: String, description: Old Place of issue of the Passport>
},
"passport_num": {
"value": <type: String, description: Passport Number of the holder>
},
"spouse": {
"value": <type: String, description: Spouse name of the holder>
},
"pin": {
"value": <type: String, description: holder’s Pin Code in address>
},
"barcode": {
"value": <type: String, description: Barcode number extracted from the Input Passport Image>
},
"qualityCheck": {
"isBlackWhite": “NA”
}
22
{
"status": "success",
"clientRefId": "nnn",
"ocrReqId": "xxxx",
"statusCode": 200,
"result": [ < resultObject1 > , < resultObject2 > , ..]
}
{
"doc_type": “kyc_document”,
"conf": "< confidence score of the detected KYC doc >"
}
--------END OF DOCUMENT--------
23