OCR (Optical Character Recognition) Document
This is API specification for OCR (Optical Character Recognition) Document as a part of eKYC service provided by FinOS Technology VN.
Version : v1.0.0
Prerequisite
Steps
Step 1 : Register an account at
Step 2 : Search API want to use and do the Subscribe
Step 3 : Get [API Key] and add to header of request
Variables
National ID card extraction
1. Request
Method
URL
POST
[Host]/ekyc/ocr/v2/nationalID
Header
Header
Value
Required
Note
X-FinOS-Api-Key
[API Key]
Yes
transactionId
Unique Id
No
Body
Params
Type
Required
Note
image
File
Yes
Image file
enableAddressSplit
String
No
Split field permanentAddress into separate province, ward, district. Possible value : yes / no
qualityCheck
String
No
Allow do quality check. Possible value : yes / no
2. CURL
curl --location --request POST '[Host]/ekyc/ocr/v2/nationalID' \
--header 'Content-Type: multipart/form-data;' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'X-FinOS-Api-Key: [API Key]' \
--header 'transactionId: test-postman' \
--form 'image="/cccd_chip.png"' \
--form 'enableAddressSplit="yes"' \
--form 'fraudCheck="yes"' \
--form 'faceCheck="yes"' \
--form 'forgeryCheck="yes"' \
--form 'qualityCheck="yes"'
3. HTTP Status
Status Code
Error Message
Error Description
400
Invalid image file uploaded
This error is returned when ‘image’ is not sent or more than 2 images in the API call
401
API Key is not valid or is expired / revoked.
Unauthorization due to invalid [API Key]
413
The request is larger than the server is willing or able to process
Uploaded image too large
422
National ID not detected
Service could not find National ID in input image
429
Rate limit exceeded
This error is returned when the number of transactions per minute has crossed the limit
500
Internal Server Error
Something wrong with server when processing request
4. Object “SUMMARY” in response
This object is help to consolidating all the checks during the processing.
Possible value : “Manual Review” & “pass”
Error Message
Code
Message
Check Type
001
Không nhận diện được CMND/ CCCD
046
Không nhận diện được ảnh chân dung trên CMND/CCCD
Quality Check
044
Vui lòng chỉ chụp CMND/ CCCD gốc
Quality Check
045
CMND/CCCD chụp từ thiết bị khác
Quality Check
047
CMND/CCCD đã bị cắt góc
Quality Check
048
CMND/CCCD bị mờ
Quality Check
049
CMND/CCCD bị chói sáng
Quality Check
061
CMND/CCCD không hợp lệ
Rule Check - Date Of Expiry Validation
063
ID Number Gender Code Invalid
Rule Check - Year Of Birth & Gender Code Validation
064
CMND/CCCD không hợp lệ
Rule Check - ID Number Validation (Length of ID number is either 9 or 12 digits)
5. Response
200 : Success
{
"status": "success",
"statusCode": "200",
"result": {
"details": [
{
"fieldsExtracted": {
"idNumber": {
"value": "030187003568",
"to-be-reviewed": "no"
},
"name": {
"value": "PHẠM THỊ THU THỦY",
"to-be-reviewed": "no"
},
"dob": {
"value": "08-08-1987",
"to-be-reviewed": "no"
},
"homeTown": {
"value": "Xã Thanh Lang, Huyện Thanh Hà, Tỉnh Hải Dương",
"to-be-reviewed": "no"
},
"permanentAddress": {
"value": "P509-K2 Nghĩa Tân, Cầu Giấy, Hà Nội",
"province": "Hà Nội",
"ward": "P509-K2 Nghĩa Tân",
"district": "Cầu Giấy",
"street": "",
"to-be-reviewed": "no"
},
"gender": {
"value": "Nữ",
"to-be-reviewed": "no"
},
"doe": {
"value": "08-08-2027",
"to-be-reviewed": "no"
},
"nationality": {
"value": "Việt Nam",
"to-be-reviewed": "no"
}
},
"qualityChecks": {
"faceNotDetected": {
"value": "no",
"to-be-reviewed": "no"
},
"blur": {
"value": "no",
"to-be-reviewed": "no"
},
"glare": {
"value": "no",
"to-be-reviewed": "no"
},
"partialID": {
"value": "no",
"to-be-reviewed": "no"
},
"blackAndWhite": {
"value": "no",
"to-be-reviewed": "no"
},
"capturedFromScreen": {
"value": "no",
"to-be-reviewed": "no"
}
},
"ruleChecks": {
"idDOBGenderCodeInvalid": {
"value": "no",
"to-be-reviewed": "no"
},
"idNumberLengthMismatch": {
"value": "no",
"to-be-reviewed": "no"
}
},
"tamperChecks": {},
"type": "cccd_chip_front"
}
],
"summary": {
"action": "pass",
"details": []
}
},
"requestId": "5ec86801-ce39-429c-8868-01ce39529c26",
"transactionId": "FinOS_An_Test_Transaction"
}
400 : Input has error
{
"status": "failure",
"statusCode": "400",
"error": "Invalid image file uploaded",
"requestId": "9d513529-6582-4ed3-8a5f-45a6383cc471",
"transactionId": "FinOS_An_Test_Transaction"
}
401 : Unauthorization
{
"message": "Unauthorized",
"http_status_code": 401
}
422 : National ID not detected
{
"status": "failure",
"statusCode": "422",
"result": {
"summary": {
"action": "Manual Review",
"details": [
{
"code": "001",
"message": "Không nhận diện được CMND/ CCCD"
}
]
}
},
"error": "Vietnam National ID Not Detected",
"requestId": "d88de077-9f5e-4b10-8de0-779f5eeb103a",
"transactionId": "FinOS_Automation_Test_Transaction"
}
500 : Server error
{
"status": "failure",
"statusCode": "500",
"error": "Internal Server Error"
}
6. Data Extracted
VietNam ID Card Type
Type Code
Fields
Old Nation ID Front Side
cmnd_old_front
idNumber, name, dob, province, homeTown, permanentAddress
Old Nation ID Back Side
cmnd_old_back
doi, placeOfIssue, doe, ethnicity
New National ID Front Side
cmnd_new_front
idNumber, name, gender, dob, permanentAddress, doi, doe, province, homeTown, ethnicity
Citizen ID Front Side
cccd_front
idNumber, name, gender, dob, permanentAddress, doi, doe, province, homeTown, nationality
New National ID/Citizen ID Back Side
cmnd_new_cccd_back
doi, placeOfIssue
Chip Citizen ID Front Side
cccd_chip_front
idNumber, name, gender, dob, permanentAddress, doe, province, homeTown, nationality
Chip Citizen ID Back Side
cccd_chip_back
doi, placeOfIssue
7. Document Checks
Quality Check
Name
Description
ID Card Type Supported
Glare Detection
Detect uploaded image are blured
cmnd_old_front, cmnd_new_front, cccd_front, cccd_chip_front
Blur Detection
Detect uploaded image are glare due to flash light
cmnd_old_front, cmnd_new_front, cccd_front, cccd_chip_front
Face Check
Detect user photo on the ID card is visible
cmnd_old_front, cmnd_new_front, cccd_front, cccd_chip_front
Coner Cut Check
Check ID card is cut
cmnd_old_front, cmnd_new_front, cccd_front
Black & White Detection
Detect ID Card is a black & white photocopy
cmnd_old_front, cmnd_new_front, cccd_front, cccd_chip_front
Captured From Screen Detection
Detect ID Card is captured from another screen
cmnd_old_front, cmnd_new_front, cccd_front, cccd_chip_front
Partial ID Card Detection
Detect any edge of ID Card is cut off
cmnd_old_front, cmnd_new_front, cccd_front, cccd_chip_front
Rule Check
Name
Description
ID Card Type Supported
Year Of Birth & Gender Code Validation
Check Year Of Birth & Gender matches with National ID number
cmnd_new_front, cccd_front, cccd_chip_front
National ID number Length Check
Check length of National ID number is correct
cmnd_old_front, cmnd_new_front, cccd_front, cccd_chip_front
Date Of Expiry Validation
Check the date of issued is pass the date of expiry
Vietnam Driver License Extraction
1. Request
Method
URL
POST
[Host]/ekyc/ocr/v1/readDL
Header
Header
Value
Required
Note
X-FinOS-Api-Key
[API Key]
Yes
transactionId
Unique Id
No
Body
Params
Type
Required
Note
image
File
Yes
Image file
2. CURL
curl --location --request POST '[Host]/ekyc/ocr/v1/readDL' \
--header 'Content-Type: multipart/form-data;' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'X-FinOS-Api-Key: [API Key]' \
--header 'transactionId: test-postman' \
--form '"/dl.jpeg"'
3. HTTP Status
Status Code
Error Message
Error Description
400
Invalid image file uploaded
This error is returned when ‘image’ is not sent or more than 2 images in the API call
401
API Key is not valid or is expired / revoked.
Unauthorization due to invalid [API Key]
413
The request is larger than the server is willing or able to process
Uploaded image too large
429
Rate limit exceeded
This error is returned when the number of transactions per minute has crossed the limit
500
Internal Server Error
Something wrong with server when processing request
4. Response
200 : Success
{
"status ": "success" ,
"statusCode ": "200" ,
"result ": [
{
"type ": "dl_new_front" ,
"details ": {
"name ": {
"value ": "LÊ VĂN A" ,
"conf ": 0.89 ,
"to-be-reviewed ": "no"
} ,
"dob ": {
"value ": "23/01/1957" ,
"conf ": 0.59 ,
"to-be-reviewed ": "yes"
} ,
"expiry ": {
"value ": "11/04/2024" ,
"conf ": 0.75 ,
"to-be-reviewed ": "yes"
} ,
"address ": {
"value ": "89 Bình Quới P.13, Q4, TP. Hồ Chi Minh" ,
"conf ": 0.75 ,
"to-be-reviewed ": "yes"
} ,
"nationality ": {
"value ": "Việt Nam" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
}
}
}
] ,
"requestId ": "1651714366996-e41f102a-c5ce-454b-866b-07d19e95319b"
}
400 : Input has error
{
"status ": "failure" ,
"statusCode ": "400" ,
"error ": "API call requires one input image" ,
"requestId ": "1651715773797-0dcdcace-1292-4aa4-9fec-48528a64ff78" ,
"transactionId ": "xxxxxx"
}
401 : Unauthorization
{
"requestId ": "" ,
"status ": "failure" ,
"statusCode ": "401" ,
"error ": "API Key is not valid or is expired / revoked."
}
500 : Server error
{
"status ": "failure" ,
"statusCode ": "500" ,
"error ": "Internal Server Error"
}
Vietnam Passport Extraction
1. Request
Method
URL
POST
[Host]/ekyc/ocr/v1/readVNPassport
Header
Header
Value
Required
Note
X-FinOS-Api-Key
[API Key]
Yes
transactionId
Unique Id
No
Body
Params
Type
Required
Note
image
File
Yes
Image file
2. CURL
curl --location --request POST '[Host]/ekyc/ocr/v1/readVNPassport' \
--header 'Content-Type: multipart/form-data;' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'X-FinOS-Api-Key: [API Key]' \
--header 'transactionId: test-postman' \
--form '"/passport.jpeg"'
3. HTTP Status
Status Code
Error Message
Error Description
400
Invalid image file uploaded
This error is returned when ‘image’ is not sent or more than 2 images in the API call
413
The request is larger than the server is willing or able to process
Uploaded image too large
422
Passport not detected
This error is returned when passport not detected in ‘image’
401
API Key is not valid or is expired / revoked.
Unauthorization due to invalid [API Key]
429
Rate limit exceeded
This error is returned when the number of transactions per minute has crossed the limit
500
Internal Server Error
Something wrong with server when processing request
4. Response
200 : Success
{
"status ": "success" ,
"statusCode ": "200" ,
"result ": [
{
"type ": "vn_passport_front" ,
"details ": {
"place_of_issue ": {
"value ": "Cục Quản lý xuất nhập cảnh" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"passport_num ": {
"value ": "BC2810463" ,
"conf ": 0.88 ,
"to-be-reviewed ": "no"
} ,
"type ": {
"value ": "P" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"name ": {
"value ": "PHẠM THỊ TUYẾT" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"dob ": {
"value ": "01/07/1999" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"gender ": {
"value ": "NỮ/F" ,
"conf ": 0.95 ,
"to-be-reviewed ": "no"
} ,
"doe ": {
"value ": "30/03/2027" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"doi ": {
"value ": "30/03/2017" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"country_code ": {
"value ": "VNM" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"place_of_birth ": {
"value ": "TỈNH NAM ĐỊNH" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"nationality ": {
"value ": "VIETNAMESE" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
} ,
"fraudCheck ": {
"isBlackWhite ": {
"value ": "no" ,
"conf ": 0.99 ,
"to-be-reviewed ": "no"
}
} ,
"id ": {
"value ": "192257877" ,
"conf ": 1 ,
"to-be-reviewed ": "no"
}
}
}
] ,
"requestId ": "1651715211177-d9ee1a5e-6395-47bc-84ad-4d8cbee13719"
}
400 : Input has error
{
"status ": "failure" ,
"statusCode ": "400" ,
"error ": "API call requires one input image" ,
"requestId ": "1651715773797-0dcdcace-1292-4aa4-9fec-48528a64ff78" ,
"transactionId ": "xxxxxx"
}
422 : Passport not detected
{
"status ": "failure" ,
"statusCode ": "422" ,
"error ": "Passport not detected" ,
"requestId ": "02d79c9d-5893-474e-979c-9d5893b74e9b" ,
"transactionId ": "xxxxxx"
}
401 : Unauthorization
{
"requestId ": "" ,
"status ": "failure" ,
"statusCode ": "401" ,
"error ": "API Key is not valid or is expired / revoked."
}
500 : Server error
{
"status ": "failure" ,
"statusCode ": "500" ,
"error ": "Internal Server Error"
}
Vietnam MRC (Motor Registration Certificate)
1. Request
Method
URL
POST
[Host]/ekyc/ocr/v1/readMRC
Header
Header
Value
Required
Note
X-FinOS-Api-Key
[API Key]
Yes
transactionId
Unique Id
No
Body
Params
Type
Required
Note
image1
File
Yes
Image file
image2
File
No
Image file
2. CURL
curl --location --request POST '[Host]/ekyc/ocr/v1/readMRC' \
--header 'Content-Type: multipart/form-data;' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'X-FinOS-Api-Key: [API Key]' \
--header 'transactionId: test-postman' \
--form 'image2=@"/MRC_new_back.jpeg"' \
--form 'image1=@"/MRC_old_back.png"'
3. HTTP Status
Status Code
Error Message
Error Description
400
API call requires one input image
This error is returned when 'image1' is not sent in the API call
400
Invalid image file uploaded
This error is returned when has more than 2 images sent under param 'image1' or 'image2' in the API call
413
The request is larger than the server is willing or able to process
Uploaded image too large
422
MRC not detected
This error is returned when mrc not detected in ‘image’
401
API Key is not valid or is expired / revoked.
Unauthorization due to invalid [API Key]
429
Rate limit exceeded
This error is returned when the number of transactions per minute has crossed the limit
500
Internal Server Error
Something wrong with server when processing request
4. Response
200 : Success
{
"status ": "success" ,
"statusCode ": "200" ,
"result ": [
{
"type ": "old_register_card_back" ,
"details ": {
"name ": {
"value ": "TÔ THỊ NGHĨA" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"address ": {
"value ": "Triều Khúc Tân Triều Thanh Trì" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"brand ": {
"value ": "FUTURE" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"kind ": {
"value ": "NỮ" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"color ": {
"value ": "Đỏ" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"engine-number ": {
"value ": "0632416" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"chassis-number ": {
"value ": "218638" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"number-plate ": {
"value ": "12X7-1210" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"place-registration ": {
"value ": "Hà Nội" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"first-registration-date ": {
"value ": "10/03/2007" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"last-registration-date ": {
"value ": "10/3/2007" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"place-of-issue ": {
"value ": "" ,
"conf ": 1.0 ,
"to-be-reviewed ": "yes"
}
}
},
{
"type ": "new_register_card_back" ,
"details ": {
"name ": {
"value ": "HOÀNG VĂN CHIỀU" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"address ": {
"value ": "Làng Áng, Lâu Thượng, Võ Nhai, TN" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"brand ": {
"value ": "HONDA" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"kind ": {
"value ": "" ,
"conf ": 1.0 ,
"to-be-reviewed ": "yes"
} ,
"color ": {
"value ": "Xám Đen" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"engine-number ": {
"value ": "7F94E1949990" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"chassis-number ": {
"value ": "QWZIF782XM2107638" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"number-plate ": {
"value ": "30D2-136.44" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"place-registration ": {
"value ": "Võ Nhân" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"first-registration-date ": {
"value ": "" ,
"conf ": 1.0 ,
"to-be-reviewed ": "yes"
} ,
"last-registration-date ": {
"value ": "20/03/2021" ,
"conf ": 1.0 ,
"to-be-reviewed ": "no"
} ,
"place-of-issue ": {
"value ": "" ,
"conf ": 1.0 ,
"to-be-reviewed ": "yes"
}
}
}
] ,
"requestId ": "1b4c0d85-46e1-459c-8c0d-8546e1459ced" ,
"transactionId ": "transactionId"
}
400 : Input has error
{
"status ": "failure" ,
"statusCode ": "400" ,
"error ": "API call requires one input image" ,
"requestId ": "97a92569-67f0-40d2-87ff-cbb5b6901223" ,
"transactionId ": "transactionId"
}
{
"status ": "failure" ,
"statusCode ": "400" ,
"error ": "Invalid image file uploaded" ,
"requestId ": "21567e88-959f-4d54-a4e4-a36ea4e4a2d3" ,
"transactionId ": "transactionId"
}
422 : MRC not detected
{
"status ": "failure" ,
"statusCode ": "422" ,
"error ": "MRC Not Detected" ,
"requestId ": "8e4df369-7a19-428a-8df3-697a19228a03" ,
"transactionId ": "transactionId"
}
401 : Unauthorization
{
"requestId ": "" ,
"status ": "failure" ,
"statusCode ": "401" ,
"error ": "API Key is not valid or is expired / revoked."
}
500 : Server error
{
"status ": "failure" ,
"statusCode ": "500" ,
"error ": "Internal Server Error" ,
"requestId ": "02d727c9d-5893-474e-979c-9d76867b74e9b" ,
"transactionId ": "transactionId"
}