initialize

Overview

  • API URL:/api/v1/zoloz/nfc/initialize
  • API Description: The ZOLOZ NFC initialize API is used to initialize the NFC reading process in the ZOLOZ. A unique transaction ID is generated for the process and used in all subsequent interactions with the ZOLOZ server. This API is not idempotent.

Structure

Request parameters 

Field name

Data type

Max length 

Description 

Example

bizId

String

32

Required. A unique business ID for tracing purposes. For example, the sequence ID from the merchant's business-related database.

Note: The ZOLOZ server does not perform uniqueness checks on the value of this field. For better tracking, it is strongly recommended to enable the merchant server to guarantee the uniqueness of the business ID. 

"781852350934518"

metaInfo

String

512

Required. The meta information about the SDK and the user's device. The value of this field comes from the ZOLOZ SDK in JSON string format. 

Note: Do not modify the return value as it only needs to be passed in directly. 

"{ 

\"deviceType\": \"android\", \"appVersion\": \"1.0.9\", \"osVersion\": \"9\", \"appName\": \"com.zoloz.atomic.client\", \"bioMetaInfo\": \"3.46.0:2916352,0\", \"apdidToken\": \"69b74bfe-bf7f-4d3b-ac59-907ee09e7955\", \"deviceModel\": \"MI 6\", \"zimVer\": \"1.0.0\" }"

docType

String

16

Required. Specifies the type of document. NFC only supports the following two document types: 

  • 00000001003: Passport
  • 00860000011: Mainland China Resident's Permit for travelling to and fro Hong Kong and Macau.

"00860000011"

userId

String

64

Required. Merchant user ID, or other identifiers that can be used to identify a specific user. 

For example, mobile phone number, email address and so on.  It is strongly recommended to pre-desensitize the value of the userId field; for example, by hashing the value. 

"123456abcd"

nfcConfig

NFCConfig

Optional. Configuration for NFC products. 

"dateOfBirth": "900115", "dateOfExpiry": "281015", "documentNumber": "E40431234", "needClientOCR": "N" }

NFCConfig

Field name

Data type

Max length 

Description 

Example

needClientOCR

String

1

Required. Specifies whether to perform OCR recognition through the client. The following values are supported: 

  • Y: Yes. When needClientOCR is Y, client-side OCR recognizes the documentNumber, dateOfBirth and dateOfExpiry fields without the need to pass them in separately.
  • N: No. When the needClientOCR is N, the documentNumber, dateOfBirth and dateOfExpiry fields must be passed in.

Note: The default value is Y.

"Y"

documentNumber

String

9

Optional. ID number. 

"E40431234"

dateOfBirth

String

6

Optional. Date of birth in yyMmdd format. 

Note: This field has a fixed length and must contain 6 digits. 

"900115"

dateOfExpiry

String

6

Optional. Document date of expiry in yyMmdd format.

Note: This field has a fixed length and must contain 6 digits. 

"281015"

Response parameters 

Field name

Data type

Description 

Example

result 

Result

Required. The API request result, which contains information about the result of the API request, such as status and error codes. 

"resultStatus": "S", "resultCode": "SUCCESS", "resultMessage": "Success" 

}

transactionId

String

Optional. A unique transaction ID that is generated by the ZOLOZ server for the NFC Reader. This ID will be used as an input parameter for the NFC checkresult API request.

Note: When an error occurs during the process, for example, an invalid argument, no transaction ID will be returned.

"G000000005FID20200304000000000001570702"

clientCfg

String

Optional. The client configuration information, including parameters about the SDK connection and behavior. 

Note: The value of this field is specified only when the result.resultStatus field is "S".

"……"

Result 

Result process logic 

For different request results, different actions will be performed. See the following for details:

  • If the value of the result.resultStatus is S , the ZOLOZ NFC initialize API is invoked successfully and a unique transaction ID is returned.
  • If the value of the result.resultStatus is F , the invocation of the ZOLOZ NFC initialize API fails. Check the error code and its message for more information on the possible reasons why.

Common error codes

For the full list of common error codes, see the Common error codes section in the Error handling topic. 

API-specific result codes 

The following table shows the possible error codes that are specific to the ZOLOZ NFC initialize API.

resultCode

resultStatus

Description

SUCCESS

S

The API call is successful.

HIGH_RISK

F

High risk has been detected. The user account will be strategically cooled down by the risk engine.

ACCOUNT_SERVICE_SUSPEND

F

The user account has been blacklisted by the risk engine.

DEVICE_NOT_SUPPORT

F

The device type is not supported. 

OS_NOT_SUPPORT

F

The operating system of the device is not supported.

SDKVERSION_NOT_SUPPORT

F

The version of the ZOLOZ SDK is not supported.

INVALID_ARGUMENT

F

Input parameters are invalid. 

For more information about which parameter is invalid, check the result message or the related log.

SYSTEM_ERROR

F

Other internal errors. For more information about the error details, check the result message or the related log.

Samples

Request sample

The following sample shows what a request sent from the merchant server looks like. 

copy
{
  "bizId": "781852350934518",
  "docType": "00860000011",
  "metaInfo": {
    "apdidToken": "53237637-3082-4297-bf0f-e4fa2a4ef933",
    "appName": "com.zoloz.saas.demoapp",
    "appVersion": "1.3",
    "bioMetaInfo": "3.61.0:5570560,2;JIAJAAAAAAAAAAAJ",
    "deviceModel": "MI 6",
    "deviceType": "android",
    "jsonFormat": false,
    "osVersion": "9",
    "sdkVersion": "3.61.0",
    "zimVer": "1.0.0"
  },
  "nfcConfig": {
    "dateOfBirth": "900115",
    "dateOfExpiry": "281015",
    "documentNumber": "E40431234",
    "needClientOCR": "N"
  },
  "userId": "123456abcd"
}

Response sample

The following sample shows what a response returned from the ZOLOZ server looks like. 

copy
{
   "result": {
        "resultStatus": "S",
        "resultCode": "SUCCESS",
        "resultMessage": "Success"
    },
  "transactionId":"G000000005FID20200304000000000001570702", 
  "clientCfg": "……"   
}