OCR API provides document image recognition and returns corresponding document information.
API Method
Base URL
- Indonesia:https://id.apitd.net/verification/kyc/ocr/v1
- Pakistan:https://pk.apitd.net/verification/kyc/ocr/v1
API
URL | Request Methods | Content-Type | Output Format | Character Set |
---|---|---|---|---|
api-base-url?partner_code=xxx&partner_key=xxx | POST | application/json | JSON | UTF-8 |
Authentication
Parameter | Type | Description | Required/Optional | Notes |
---|---|---|---|---|
partner_code | String | Partner Code | Required | Assigned by TD |
partner_key | String | Partner Key | Required | Assigned by TD |
Request
Parameter | Type | Description | Required/Optional | Notes |
---|---|---|---|---|
image | String | ID card image | Required | ID photo,base64 photo of JPG,JPEG,PNG format, the image size limits to 3M |
country | String | Country | Required | 2-letter country code according to ISO 3166. Only support: Indonesia(ID), Pakistan(PK) |
options | String | Additional feature output | Optional | Input "en" in this field, and the following fields of the Pakistan Identity Card will return the English translation results of Urdu language: 1. 'name' and 'fathername' fields of NIC documents 2. 'currentaddress_en' and 'permanent_address_en' fields of NIC/CNIC documents *Note: If required, please contact business/operations for individual activation of this enhanced configuration. |
Response Parameter
Parameter | Type | Description | Required/Optional | Note |
---|---|---|---|---|
code | Integer | API status code | Required | |
message | String | Status Information | Required | Specific error reasons will be provided when the API is abnormal |
sequence_id | String | Unique response code | Required | A unique ID used to track each request |
result | String | Result | Conditionally Required | Returned when code=200. Enumeration: 1. success 2. fail |
card_info | JSONObject | ID card information | Conditionally Required | Returned when result is success |
Supported ID types
-
KTP
Parameter Type Description nik String ID card name String Name birthday String Date of birth birthplace String Place of birth gender String Gender blood_type String Blood group address String Address rt_rw String RT/RW village String Village street String Street (District) religion String Religion marital_status String Marital status occupation String Career nationality String Country of Citizenship expiry_date String Validity period issue_date String Issue date issue_location String Issue location province String Province of residence -
Pakistan NIC/CNIC(front and back side)
Parameter Type Description CNIC OR NIC card_side String The side of card: front
id_number String ID card number CNIC/NIC expiry_date String Expiry date of the card CNIC issue_date String Issue date of the card CNIC name String Name in English
Note: If English translation is required for this field of the NIC document, please contact business/operations to individually activate this enhanced configuration.CNIC name_urdu String Name in Urdu CNIC/NIC birthday String Date of birth CNIC/NIC gender String Gender CNIC/NIC father_name String Father's name
Note: If English translation is required for this field of the NIC document, please contact business/operations to individually activate this enhanced configuration.CNIC/NIC father_name_urdu String Father's name in Urdu CNIC/NIC identifier String Personal identifier NIC country_of_stay String Country of stay CNIC Parameter Type Description CNIC OR NIC card_side String The side of card: back id_number String ID card number CNIC/NIC current_address String Current address CNIC/NIC expiry_date String Expiry date of the card NIC family_number String Family number NIC permanent_address String Permanent address CNIC/NIC issue_date String Issue date of the card NIC current_address_en String Current address in English
Note: If required, please contact business/operations to individually activate this enhanced configuration.CNIC/NIC permanent_address_en String Permanent address in English
Note: If required, please contact business/operations to individually activate this enhanced configuration.CNIC/NIC
API Status Code
Code | Message | Description |
---|---|---|
200 | Success | Call Successfully |
301 | Service not purchased | No purchase of the servive |
302 | Traffic blocked | Traffic blocked |
303 | Traffic insufficient | Traffic insufficient |
304 | Service expired | Service expired |
305 | Daily maximum volume reached | Daily maximum volume reached |
12601 | Detection failed | Cannot recognize this image |
12602 | Document detected as having bad quality | The document has been detected but the quality is low. *Only applies to Indonesian OCR service |
11350 | Internal error | Internal error |
11301 | {parameter} empty | {parameter} empty |
11304 | The country partner located is not open | The country partner located is not open |
11340 | {parameter} error | {parameter} error |
Response Example
-
Request
{ "image": "/9j/4AAQSkZJRgABAQAAeAB4AAD/********XLiqqauzsw1J3sf/2Q==", "country": "PK" }
-
Success
{
"result":"success",
"code":200,
"sequence_id":"1704275269816000X0A366B271******",
"message":"success",
"card_info":{
"birthday":"10/12/19**",
"identifier":"ش**تل",
"id_number":"3****-21*****-1",
"card_side":"front",
"country_of_stay":"",
"gender":"M",
"issue_date":"",
"father_name":"",
"expiry_date":"",
"name":"",
"father_name_urdu":"و*****شق",
"name_urdu":"نم*****د"
}
}
- Failed
{
"code": 11350,
"sequence_id": "69b57131b6fb********61ccba118b60",
"message": "Internal error"
}