Overview
-
API URL: POST
/api/v1/zoloz/idrecognition/asyncrecognize -
API Description: The ZOLOZ ID Recognition asyncrecognize API initializes an asynchronous document recognition request. When you need to call the recognize API frequently, use the asyncrecognize API to avoid response timeouts caused by network fluctuations. After the API call completes, retrieve the document verification results through the asynccheckresult API.
Request
Fields Specification
|
Field name |
Data type |
Max length |
Default Value |
Description |
Example |
|
bizId |
String |
32B |
- |
Required. A unique ID maintained by the client for tracing purposes. |
"trans-test-1234" |
|
docType |
String |
32B |
null |
Optional. Type of document.
Note:
|
"00000001003" |
|
autoDocTypes |
List<String> |
200 |
null |
Optional. Specifies the document types to accept. The system automatically classifies uploaded documents. This parameter can be used alone or combined with the
Supported document types, see Document types supported and OCR results returned. |
[ "08520000001", "08520000002" ] |
|
autoDocCategory |
List<String> |
- |
null |
Optional. Specifies document type categories. The system automatically classifies uploaded documents. This parameter can be used alone or combined with the
Note: When |
"ID_CARD" |
|
autoDocCountrycode |
List<String> |
300 |
null |
Optional. Specifies the country or region of the document. Supports
For example:
Note:
For example:
Note:
To ensure your system smoothly adapts to newly supported document-issuing countries, we recommend implementing compatibility measures in advance—for example, avoiding strict validation of the returned |
["CHN","PHI"] |
|
frontPageImage |
String |
5MB |
- |
Required. The front image of the document, Base64 encoded in JPG, JPEG, PNG, or BMP format. Note: The total size of |
"/9j/4AA..[omitted]..PxA=" |
|
backPageImage |
String |
5MB |
- |
Optional. Required. The back image of the document, Base64 encoded in JPG, JPEG, PNG, or BMP format. Note: The total size of |
"/9j/4AA..[omitted]..PxA=" |
|
operationMode |
String |
32 |
STANDARD |
Optional. Specifies the identity proofing operation mode. The following values are supported:
|
"STANDARD" |
|
sceneCode |
String |
64 |
null |
Optional. Specifies the business scene for data analysis. To distinguish data performance across different scenes, set |
"changePassword" |
|
userId |
String |
64 |
null |
Optional. Merchant user ID or other user identifier, such as a mobile phone number or email address. Pre-desensitizing the value (for example, by hashing) is strongly recommended. |
"trans-abc-1234" |
|
productConfig |
ProductConfig |
- |
null |
Optional. Specifies finer controls for the IDR product. For more information, see productConfig. |
{ "consistencyCheck": [ { "type": "commonConsistencyCheck" }, { "details": [ "NAME", "SEX" ], "type": "mrzVisualConsistencyCheck" } ] } |
ProductConfig
|
Field name |
Data type |
Max length |
Default Value |
Description |
Example |
|
pageInfoCheck |
Array |
- |
null |
Optional. Specifies page information checks within DOC spoofing check. For detailed inspection items, see the DOC spoofing check component. Note: Page information check is only applicable to the following document types:
|
[ {"name":"id"}, {"name":"symbol"}, {"name":"name"} ] |
|
consistencyCheck |
List<ConsistencyCheckItem> |
- |
null |
Optional. Specifies whether to perform a consistency check. Consistency checks apply only to specific fields of certain documents. |
[ { "type": "commonConsistencyCheck" }, { "details": [ "NAME", "SEX" ], "type": "mrzVisualConsistencyCheck" }, { "valueRange": [ "CHN", "PHL" ], "type": "passportCountryCheck" } ] |
|
allowExpiredDocument |
String |
- |
Different document types have different default values:
|
Optional. Specifies whether expired documents are allowed. The following values are supported:
Note:
|
"N" |
|
cropFaceImageFromDoc |
String |
1 |
N |
Optional. Specifies whether to crop the face area of the captured doc image. Valid values include:
|
"Y" |
|
enableOCR |
String |
- |
N |
Optional. Whether to enable the OCR function. The values are as follows:
|
"Y" |
|
spoofMode |
tring |
10 |
CLOSED |
Optional. Document anti-spoofing level. Valid values:
Note: You need to purchase the Spoof product before you can use this feature. |
"STANDARD" |
|
deeperMode |
String |
10 |
CLOSED |
Optional. AIGC attack detection level (Deeper). For more information, see What Is Deeper. This parameter supports the following values:
|
"STANDARD" |
ConsistencyCheckItem data structure
commonConsistencyCheck
|
Field name |
Data type |
Value range |
Description |
Supported ID / Country or Region / docType / OCR field to check |
|
type |
String |
commonConsistencyCheck |
Consistency check of OCR field within DOC spoofing check |
Mykad / Malaysia / 00600000001 / ID_NUMBER
|
mrzVisualConsistencyCheck
|
Field name |
Data type |
Value range |
Description |
Supported ID / Country or Region / docType / OCR field to check |
|
type |
String |
mrzVisualConsistencyCheck |
Consistency check of OCR field which has both MRZ (machine readable zone) and VIZ (visual inspection zone)within DOC spoofing check |
- |
|
details |
List<String> |
Refer to supported ocr fileds of each docType |
Specify ocr field in details for consistency check.
|
MyVisa / Malaysia / 00600000011 /
|
|
Passport (both MRZ and VIZ) / All countries or regions / 00000001006 /
|
||||
|
Travel Permit for Hong Kong and Macau / China / 00860000011
|
passportCountryCheck
|
Field name |
Data type |
Value range |
Description |
Supported ID / Country or Region / docType / OCR field to check / default country code |
|
type |
String |
passportCountryCheck |
Checks that the |
|
|
valueRange |
List<String> |
Each value should be the same as the default country code. |
The When the |
For below docTypes,
|
|
Each value should comply with ISO_3166-1_alpha-3 |
For below docTypes,
|
Request Sample
POST /api/v1/zoloz/idrecognition/asyncrecognize HTTP/1.1Content-Type: application/json; charset=UTF-8Client-Id: 5X67656YXXXXXX
Request-Time: 2024-01-04T12:08:56+05:30Signature: algorithm=RSA256, signature=xxxxxxxxxxxx
{
"bizId": "trans-test-1234",
"autoDocTypes":["08520000001","08520000002"],
"frontPageImage": "/9j/4AA..[omitted]..PxA=",
"backPageImage": "/9j/4AA..[omitted]..PxA=",
"productConfig": {
"deeperMode": "STANDARD",
"consistencyCheck": [
{
"type": "commonConsistencyCheck" },
{
"details": [
"NAME",
"SEX" ],
"type": "mrzVisualConsistencyCheck" },
{
"valueRange": [
"CHN",
"PHL" ],
"type": "passportCountryCheck" }
],
"pageInfoCheck": [
{
"name": "id" },
{
"name": "symbol" },
{
"name": "name" }
],
"allowExpiredDocument": "Y",
"cropFaceImageFromDoc": "Y",
"enableOCR": "Y",
"spoofMode": "STANDARD" },
"operationMode": "STANDARD",
"sceneCode": "changePassword",
"userId": "userid_1234"}
Response
Fields Specification
|
Field name |
Data type |
Description |
Example |
|
result |
Required. Common result. For more information, see Appendix. |
{ "resultCode": "PROCESSING", "resultStatus": "S", "resultMessage": "It is still under processing" } |
|
|
transactionId |
String |
Required. Transaction id Note: The system will only return the
|
"G000000005FID2020030400000000000157****" |
Response Sample
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8Response-Time: 2024-01-19T21:56:15-0800Signature: algorithm=RSA256, signature=xxxxxxxxxxxxxxxxxx
{
"transactionId": "G000000005FID2020030400000000000157****",
"result": {
"resultCode":"PROCESSING",
"resultStatus":"S",
"resultMessage":"It is still under processing" }
}
Appendix
CommonResult Model
A unified data structure that indicates the API invocation status.
Fields Specification:
|
Field name |
Data type |
Mandatory |
Value Range |
Description |
Sample Value |
|
resultCode |
string |
true |
result code |
"SUCCESS" |
|
|
resultStatus |
string |
true |
"S": successful "F": failed |
result status |
"S" |
|
resultMessage |
string |
true |
result description |
"success" |
Valid values for resultCode at the business level:
|
resultCode |
Description |
|
SUCCESS |
success |
|
SYSTEM_ERROR |
other internal errors; |
|
INVALID_ARGUMENT |
input parameters are illegal; |