This topic describes how to call the InitializeV2 operation to initiate a verification request.
API information
API operation: InitializeV2
Request method: HTTPS POST
Description: Before you start a verification flow, call this operation to obtain a transactionId. This ID is used to associate all API operations for the verification request.
QPS limit: Each API has its own QPS limit. For more information, see QPS limits of ID Verification server-side APIs.
Endpoints:
NoteBenefits of internal network access: An internal network is a private communication network connecting Alibaba Cloud products within the same region. If your application server is deployed in the same region, use the internal endpoint to access the ID Verification service for enhanced security and stability.
Optimizing overseas access: Overseas network environments can be complex. Refer to Optimize server network latency to tune your integration and reduce network latency and request failures.
Asia Pacific SE 1 (Singapore)
Public endpoint:
cloudauth-intl.ap-southeast-1.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.ap-southeast-1.aliyuncs.com
Indonesia
Public endpoint:
cloudauth-intl.ap-southeast-5.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.ap-southeast-5.aliyuncs.com
China (Hong Kong)
Public endpoint:
cloudauth-intl.cn-hongkong.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.cn-hongkong.aliyuncs.com
Asia Pacific SE 3 (Kuala Lumpur)
Public endpoint:
cloudauth-intl.ap-southeast-3.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.ap-southeast-3.aliyuncs.com
Online debugging and integration
Before debugging and integration, read the Use OpenAPI document to learn how to call APIs on the OpenAPI platform and obtain the SDK.
Go to OpenAPI Explorer to debug this API operation and generate SDK sample code.
Integration notes
A
TransactionIdis returned only upon successful initialization. The client must complete the authentication within 30 minutes of obtaining theTransactionIdorTransactionUrl. TheTransactionIdis for one-time use only. The ID becomes invalid immediately after the authentication attempt and cannot be reused to invoke the SDK, regardless of whether the authentication succeeds, fails, or is canceled by the user. To start a new authentication, you must request a newTransactionIdfrom the server-side.The
TransactionUrlis returned only for the Web SDK scenario and is valid for a single use. Do not concatenate, modify, or reuse it.Due to network latency,
CallbackUrlnotifications may be delayed. After receiving the authentication completion notification, the client must call the server-sideCheckResultoperation to obtain the final authentication details. Do not rely solely on the callback notification or the results displayed on the page.The features of the App SDK and Web SDK differ. The behavior of the Web SDK also varies between mobile H5 and PC environments. For more information about supported features, see the integration documents.
Request parameters
Description of request fields
Integration method | Scenario | Initialization response | Request parameters |
App SDK | Complete verification in a native Android or iOS app |
| Common parameters + App-specific parameters |
Web SDK | Verify in a mobile H5 page, an H5 page embedded in an app, or a PC browser |
| Common parameters + Web SDK-specific parameters |
The fields are categorized as follows:
Common parameters: Applicable to both integration methods.
App-specific: Used to customize the liveness detection action flow.
Web SDK-specific: Used to control page redirects, language/UI, and H5 fallback behavior.
Request parameters (Common)
Name | Type | Required | Description | Example |
ProductCode | String | Yes | The product code. Set the value to FACE_LIVENESS_PRO. | FACE_LIVENESS_PRO |
SceneCode | String | No | A custom ID for the authentication scenario. Use this ID to retrieve records from the console. The ID can be a 10-character string that consists of letters, numbers, and underscores. | 1234567890 |
MerchantBizId | String | Yes | A unique business identifier for the merchant, used to identify and troubleshoot issues. The identifier is a 32-character string of letters and numbers. The server-side does not validate the uniqueness of this ID. The merchant must ensure that the ID is unique. | e0c34a77f5ac40a5aa5e6ed20c35**** |
MetaInfo | String | Yes | Client environment information. Generate this information using the corresponding SDK. If you create it yourself, you must at least pass the correct Example code: Valid values for
Important Use the authentication SDK to obtain MetaInfo. This provides more accurate and detailed client information for scenarios such as authentication URL issuance, log investigation, and security checks. If you create a static MetaInfo value, make sure that `deviceType` matches the actual environment. An incorrect value will cause errors when the authentication URL is issued. | |
MerchantUserId | String | Yes | A custom user identifier, or another recognizable user identifier, such as a mobile phone number or email address. We recommend that you desensitize or hash this field. | 123456789 |
CallbackUrl | String | No | The callback URL for the authentication result. This URL must start with The platform returns an HTTP 400 error if the URL is not publicly accessible. | https://www.aliyun.com?callbackToken=100000****&transactionId=shaxxxx&passed=Y&subCode=200 |
CallbackToken | String | No | A custom security token for the merchant. Once set, this token is returned unchanged with the CallbackUrl for anti-replay and tamper-proofing verification. | NMjvQanQgplBSaEI0sL******** |
SecurityLevel | String | No | The security level. Valid values:
| 02 |
Model | String | No | Liveness detection type:
| PHOTINUS_LIVENESS |
DocVideo | String | No | Specifies whether to capture a 1- to 2-second evidence video during the face verification process. Valid values:
Video files are large. On unstable networks, the system may discard the video to prioritize uploading essential images. To get the video URL, check the | N |
FaceAttributeCheck | String | No | Face Recognition Configuration: Specifies whether to return additional facial attributes.
The output is returned in `Checkresult` at | N |
ShowGuidePage | String | No | UI configuration: Show guide page:
PC mode does not support this configuration. Supported in Native SDK version 1.4.0 and above. | 1 |
Request parameters (App-specific)
The following fields are supported only by the native App SDK.
Name | Type | Required | Description | Example |
AppQualityCheck | String | No | [Face Scan Configuration] Specifies whether to enable strict face quality detection.
Supported only in Native SDK v1.2.5 and later. The face quality detection module must be integrated. | N |
TemplateConfig | String | Conditionally required | [Face Scan Configuration] The custom action pool. This parameter is required when Model is set to TEMPLATE.
Action code lookup table:
Supported in Native SDK v1.3.6 and later. | 01,02,07 |
TemplateType | String | Conditionally required | [Face Scan Configuration] The execution order of liveness detection actions in TemplateConfig. This parameter is required when Model is set to TEMPLATE.
Supported in Native SDK v1.3.6 and later. | Seq |
NeedMultiFaceCheck | String | No | [Face Scan Configuration] Determines whether to block the request when multiple faces are detected by the terminal.
Supported in Native SDK version 1.4.1 and above. | Y |
Request parameters (Web SDK-specific)
The following fields are supported only by the Web SDK.
Field | Type | Required | Description | Example |
LanguageConfig | String | No | A JSON string for the custom language configuration. To apply the settings, convert your configuration to a JSON string based on the provided template and pass it as this parameter. For more information, see Customize Web SDK languages. Note Supported only in the mobile integration mode of the Web SDK. | |
StyleConfig | String | No | A JSON string for the custom UI configuration. To apply the configuration, convert your settings to a JSON string based on the provided template and pass it as this parameter. For more information, see Customize IDV UI styles. Note Supported only in the mobile integration mode of the Web SDK. | |
ReturnUrl | String | Conditionally required | The URL to redirect to after authentication. This is optional for the iframe embedded pattern. Provide this URL for page redirect scenarios that do not use an iframe. | https://www.alibabacloud.com |
ProcedurePriority | String | No | Specifies whether to display a fallback method when a compatibility issue occurs during mobile H5 authentication.
| url |
Returned data
Differences in returned fields
Field | App SDK | Web SDK | Note |
RequestId / Code / Message | Yes | Yes | General response information. |
Result.TransactionId | Yes | Yes | This is the unique identifier for the authentication flow, a field for billing statistics, and a request parameter for the |
Result.Protocol | Yes | Yes | Standard authentication and encryption protocol. Pass this through to the client SDK. The Web SDK requires this field for iframe embedding. |
Result.TransactionUrl | No | Yes | The Web SDK authentication URL. After authentication, it redirects to the |
Name | Type | Description | Example | |
HTTP Status Code | Integer | The HTTP status code. | 200 | |
HTTP Body | RequestId | String | The request ID. | 130A2C10-B9EE-4D84-88E3-5384FF03**** |
Code | String | The return code. For more information, see Server-side HTTP status codes. | Success | |
Message | String | A detailed description of the return code. | success | |
Result.TransactionId | String | A unique identifier for the authentication flow. This identifier is used for billing and is required for calls to the CheckResult API. Important
| hksb7ba1b28130d24e015d6******** | |
Result.TransactionUrl | String | The Web SDK verification URL. After verification, the page redirects according to the input parameter ReturnUrl. Important
| https://www.alibabacloud.com/index.html?clientcfg=**** | |
Result.Protocol | String | The encrypted string for the standard authentication protocol. Passing this parameter to the client SDK reduces network interactions and supports dynamic network switching, which improves the user experience. | hksb7ba1b28130d24e015d********* | |
Request examples
App SDK
Minimum request example
{
"ProductCode": "FACE_LIVENESS_PRO",
"MerchantBizId": "e0c34a77f5ac***e6ed20c35",
"MetaInfo": "{\"deviceType\":\"android\"}",
"MerchantUserId": "user_hash_value"
}Complete request example
{
"ProductCode": "FACE_LIVENESS_PRO",
"SceneCode": "SCENE_001",
"MerchantBizId": "e0c34a77f5ac40a5aa5e6ed20c35****",
"MetaInfo": "{\"zimVer\":\"3.0.0\",\"appVersion\":\"1\",\"bioMetaInfo\":\"4.1.0:1150****,0\",\"appName\":\"com.aliyun.antcloudauth\",\"deviceType\":\"android\",\"osVersion\":\"Android 12\",\"apdidToken\":\"\",\"deviceModel\":\"Pixel 6\"}",
"MerchantUserId": "user_hash_value_12345",
"CallbackUrl": "https://www.example.com/callback",
"CallbackToken": "NMjvQanQgplBSaEI0sL********",
"SecurityLevel": "02",
"Model": "TEMPLATE",
"DocVideo": "Y",
"FaceAttributeCheck": "Y",
"ShowGuidePage": "1",
"AppQualityCheck": "Y",
"TemplateConfig": "01,02,07",
"TemplateType": "Seq",
"TemplateRanCount": "2"
}Web SDK
Minimum request example
{
"ProductCode": "FACE_LIVENESS_PRO",
"MerchantBizId": "e0c34a77f5a***6ed20c35",
"MetaInfo": "{\"deviceType\":\"h5\"}",
"MerchantUserId": "user_hash_value",
"ReturnUrl": "https://example.com/liveness/result"
}Complete request example
{
"ProductCode": "FACE_LIVENESS_PRO",
"SceneCode": "SCENE_001",
"MerchantBizId": "e0c34a77f5ac40a5aa5e6ed20c35****",
"MetaInfo": "{\"deviceType\":\"h5\"}",
"MerchantUserId": "user_hash_value_12345",
"CallbackUrl": "https://www.example.com/callback",
"CallbackToken": "NMjvQanQgplBSaEI0sL********",
"SecurityLevel": "02",
"Model": "PHOTINUS_LIVENESS",
"DocVideo": "N",
"FaceAttributeCheck": "N",
"LanguageConfig": "{\"languageContent\":{},\"ocrResultContent\":{},\"supportedLanguage\":[\"zh-CN\"],\"titleTranslate\":{}}",
"StyleConfig": "{\"guidepage\":{},\"ocrPage\":{},\"ocrResultPage\":[],\"facePage\":{}}",
"ShowGuidePage": "1",
"ReturnUrl": "https://www.example.com/liveness/result",
"ProcedurePriority": "url"
}