All Products
Search
Document Center

ID Verification:InitializeV2

Last Updated:Nov 02, 2026

This topic describes how to call the InitializeV2 operation to initiate an eKYC-PRO request.

API information

  • Operation name: InitializeV2

  • Request method: HTTPS POST

  • Description: Before you start an authentication flow, call this operation to obtain a transactionId. This ID links all subsequent API calls for the authentication request.

  • QPS limit: Each API has its own QPS limit. For more information, see QPS limits of ID Verification server-side APIs.

  • Endpoint:

    Note
    • Benefits 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.com

    • Internal endpoint: cloudauth-intl-vpc.ap-southeast-1.aliyuncs.com

    Asia Pacific SE 5 (Jakarta)

    • Public endpoint: cloudauth-intl.ap-southeast-5.aliyuncs.com

    • Internal endpoint: cloudauth-intl-vpc.ap-southeast-5.aliyuncs.com

    China (Hong Kong)

    • Public endpoint: cloudauth-intl.cn-hongkong.aliyuncs.com

    • Internal endpoint: cloudauth-intl-vpc.cn-hongkong.aliyuncs.com

    Asia Pacific SE 3 (Kuala Lumpur)

    • Public endpoint: cloudauth-intl.ap-southeast-3.aliyuncs.com

    • Internal endpoint: cloudauth-intl-vpc.ap-southeast-3.aliyuncs.com

Online Debugging and Integration

Note

Before debugging and integration, read the Use OpenAPI document to learn how to call APIs on the OpenAPI platform and obtain the SDK.

You can go to OpenAPI Explorer to run and debug this API, and generate SDK code examples.

Integration notes

  • A TransactionId is returned only upon successful initialization. The client must complete the authentication within 30 minutes of obtaining the TransactionId or TransactionUrl. The TransactionId is 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 new TransactionId from the server-side.

  • The TransactionUrl is 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, CallbackUrl notifications may be delayed. After receiving the authentication completion notification, the client must call the server-side CheckResult operation 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.

  • Supported certificate types vary by deployment region. Before you begin, check the Certificate Type Table for your destination region.

  • Enabling Authorize may incur additional fees and has a response time of 1–30 seconds. You should configure the server-side timeout accordingly.

Request parameters

Field description

Integration method

Scenarios

Initialization API response

Request parameters

App SDK

Authenticating in a native Android or iOS app

TransactionId, Protocol

Common parameters + App-specific parameters

Web SDK

Mobile H5 or PC browser authentication

TransactionId, TransactionUrl, and Protocol

Common parameters + Web SDK-specific parameters

The fields are categorized as follows:

  • Common parameters: Can be used for both integration methods.

  • App SDK specific: Used to customize the liveness detection flow and document scanning method.

  • Web SDK specific: Used to control page redirects, language and UI, OCR pages, and H5 fallback behavior.

Request parameters (Common)

Field

Type

Required

Note

Example value

ProductCode

String

Yes

Product solution identifier. Value:

eKYC_PRO. The user must complete ID document verification and liveness detection.

eKYC_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 deviceType value.

Example code:

{
  "deviceType": "h5"
}

Valid values for deviceType:

  • Native Android app: android

  • Native iOS app: ios

  • Embedded H5 page: h5

  • PC web page: web

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.

{
  "zimVer": "3.0.0",
  "appVersion": "1",
  "bioMetaInfo": "4.1.0:1150****,0",
  "appName": "com.aliyun.antcloudauth",
  "deviceType": "h5",
  "osVersion": "iOS 10.3.2",
  "apdidToken": "",
  "deviceModel": "iPhone9,1"
}

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

IdThreshold

String

No

OCR card quality check:

  • 1: Enable strict mode

  • 2: Enable loose mode (default)

  • 3: Disable

2

IdSpoof

String

No

OCR anti-spoofing detection:

  • Y: Enable (default)

  • N: Disable

You can view the output result in CheckResult at Result.ExtIdInfo.ocrIdInfoData.{page}.spoofInfo.

Y

OcrValueStandard

String

No

OCR configuration: Specifies whether to return standardized OCR fields:

  • 0: No (default)

  • 1: Yes

The output is returned in the Result.ExtIdInfo.ocrStandardData field of CheckResult.

0

DocType

String

Yes

[OCR Configuration] Supports the following three input methods:

  1. Specify country/region: Pass in a three-letter country code. The system automatically retrieves supported document types within the specified scope and returns the specific document code upon successful recognition. Up to three codes can be specified, for example, CHN, HKG, and GLB, as the auto-classification scope. For three-letter country codes, see Country code abbreviations.

  2. Specify country/region and document category: Pass in a three-letter country code and a two-digit document category code. The system automatically retrieves supported document types within the specified scope and returns the specific document code upon successful recognition. For document type codes, see Certificate type codes.

  3. Specify exact document: Pass in the exact code of the specified document type, consisting of a three-letter country code and a five-digit document number. The system precisely identifies whether the document matches the expected type. For document type codes, see Certificate code.

Important

Supported certificate types vary by region due to model limitations.

  • Singapore and China (Hong Kong) regions: Support the certificates described in Certificate code.

  • Indonesia region: Only supports Indonesian ID cards and global passports (certificate codes IDN01001 and GLB03002).

  • Malaysia region: Only supports Malaysian ID cards and global passports (certificate codes MYS01001 and GLB03002).

Examples of the three input methods:

  • MYS: Country code for Malaysia

  • MYS01: Malaysian Identity Card

  • GLB03002: Global Passport

Pages

String

No

OCR configuration for the certificate capture page:

  • 01: Portrait side (default)

  • 01,02: Portrait side and back side

Note

Only some certificates support multi-page capture. For more information, see Certificate type table.

01

AutoDocPageConfig

String

No

[OCR Configuration] This parameter takes effect only when the DocType is set to a specific 'Country/Region Code' or 'Country/Region and Document Category'. By default, it captures only the front side of the document. To capture both the front and back for a specific document category (refer to Certificate type codes) or a precise document type (refer to Certificate code) of that country, you can configure this parameter accordingly. See the examples on the right for details.

This parameter is supported only by Native SDK 1.4.0 and later.

  • Capture both the front and back of Malaysia's new national ID:

    {
      "MYS01002": "01,02"
    }
  • Set the document category: 

    {
      "MYS01": "01,02"
    }

Model

String

No

Liveness detection type:

  • SILENT: Silent (Supported by Naive SDK 1.3.6 and later)

  • LIVENESS: Blink (default)

  • PHOTINUS_LIVENESS: Blink and color flash (Not supported in PC mode)

  • TEMPLATE: Custom liveness detection action (Not supported by Web SDK. Supported by Naive SDK 1.3.6 and later.)

PHOTINUS_LIVENESS

DocVideo

String

No

Specifies whether to capture a 1- to 2-second evidence video during the face verification process. Valid values:

  • Y: Yes

  • N (default): No

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 Result.ExtFaceInfo.docVideoUrl parameter in the CheckResult response.

N

FaceAttributeCheck

String

No

Face Recognition Configuration: Specifies whether to return additional facial attributes.

  • N: No (default)

  • Y: Returns.

The output is returned in `Checkresult` at Result.ExtFaceInfo.faceAttributeInfo.

N

ShowGuidePage

String

No

UI configuration: Show guide page:

  • 1: Show (default)

  • 0: Do not show

PC mode does not support this configuration.

Supported in Native SDK version 1.2.8 and above.

1

CallbackUrl

String

No

The callback URL for the authentication result. This URL must start with https. The platform makes a GET request to this URL and appends the transactionId, passed, and subcode parameters.

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********

Security level

String

No

The security level. Valid values:

  • 01: Normal mode. Recommended for test environments to improve testing efficiency.

  • 02: Secure mode (default). Strongly recommended for production environments.

02

Authorize

String

No

Authoritative data source validation switch:

  • T: Enable

  • F: Disable (default)

Note
  • Applicable ID document types: Chinese Resident Identity Card (CHN01001), Chinese mainland driving license (CHN02001), and Indonesian national identity card (IDN01001). For Indonesian national identity cards, this validation service is effective only when the ID document type is set to IDN01001 and the service is called from a node in Indonesia. Calling the Indonesian data source incurs additional fees. For more information, see Billing overview.

  • Data transmission statement: When you enable this parameter, you agree to transmit the user's name and ID number for consistency validation. The data is sent to an authoritative data source in the Chinese mainland, or to one in Indonesia if the input meets the conditions described above.

  • Performance impact: When enabled, the response time for the Chinese Resident Identity Card and Chinese mainland driving license APIs increases by about 1 to 2 seconds. The response time for the Indonesian national identity card API increases by 10 to 30 seconds. Adjust the timeout settings accordingly.

  • Validation results:

    • Subcode 212: Applies to the Chinese Resident Identity Card and Chinese mainland driving license APIs. The service returns this subcode when the information is inconsistent.

    • Subcodes 202, 207, 209, 214, 215, 216, 217, and 218: Apply to the Indonesian national identity card API. These subcodes indicate that the personal information does not match the submitted information. For detailed descriptions and suggestions, see Result.SubCode: Authentication result subcodes.

T

Mobile

String

Conditionally required

An Indonesian mobile number in the format of +62 followed by 9 to 11 digits. This parameter is required if Authorize=T and an Indonesian data source is used.

+6281293671234

Email

String

Conditionally required

User mailbox. Required when Authorize=T and the Indonesia data source is used.

a*@gmail.com

Request parameters (App SDK specific)

Only the native App SDK supports the following fields.

Field

Type

Required

Description

Example value

AppQualityCheck

String

No

[Face Scan Configuration] Specifies whether to enable strict face quality detection.

  • Y: Yes (default)

  • N: No

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.

  • Configuration rule: Separate multiple action codes with commas.

  • Best practice: A blinking action is required, and the total number of actions must not exceed three.

Action code lookup table:

  • Blink: 01 (required)

  • Open mouth: 02

  • Shake head left: 03

  • Shake head right: 04

  • Move camera away: 05

  • Move camera closer: 06

  • Color liveness detection: 07

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.

  • Seq: Actions are executed from left to right in the order they are configured in TemplateConfig.

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.

  • Y: Block the request and prompt the client to retry face recognition.

  • N: Do not block; select the largest face in the frame and submit it to the server for security verification. (Default)

Supported in Native SDK version 1.4.1 and above.

Y

DocScanMode

String

No

[OCR Configuration] The OCR certificate scan mode.

  • shoot: Take a photo.

  • scan: Scan automatically.

  • auto: Switch automatically between taking a photo and scanning.

Supported only in Native SDK v1.2.8 and later. The automatic scanning component must be integrated.

shoot

Request parameters (Web SDK specific)

Only the Web SDK supports the following fields.

Field

Type

Required

Note

Example value

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.

{
  "languageContent": {****},
  "ocrResultContent": {****},
  "supportedLanguage": [****],
  "titleTranslate": {****},
}

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.

{
  "guidepage:": {****}, 
  "ocrPage": {****},
  "ocrResultPage": [****],
  "facePage": {****},
}

ShowAlbumIcon

String

No

OCR configuration: Specifies whether to show the option to upload from an album during the OCR step:

  • 1: Show (default)

  • 0: Do not show

1

ShowOcrResult

String

No

OCR configuration: Controls whether to show the detection result page for the OCR step:

  • 1: Show (default)

  • 0: Do not show

1

EditOcrResult

String

No

OCR configuration: Specifies whether users can edit OCR recognition results:

  • 1: Allow (default)

  • 0: Disallow

1

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: Supports fallback. The page displays the authentication URL. Users can copy the URL and open it in a different browser to continue authentication. (Default)

  • keep: Does not support fallback. An error reason is returned, and the authentication flow ends. This option is not supported on PCs. Recommended for webpages embedded in an app.

URL

Return 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 CheckResult operation. Attach this identifier to the merchant business ID and store it only on the server-side.

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 ReturnUrl. This URL cannot be modified and can be accessed only once. You must complete the authentication within 30 minutes of obtaining the URL or TransactionId.

Name

Type

Description

Example value

HTTP status code

Integer

HTTP status code.

200

HTTP body

RequestId

String

The request ID.

130A2C10-B9EE-4D84-88E3-5384FF03****

Code

String

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
  • The init API does not return a TransactionId if the request fails, for example, due to an invalid parameter.

  • Bind the TransactionId to your business process ID and store it on the server-side. When calling the CheckResult API, retrieve this ID from your server-side storage.

  • The TransactionId or TransactionUrl is valid for 30 minutes. You must complete the authentication within this period, after which the ID expires.

hksb7ba1b28130d24e015d6********

Result.TransactionUrl

String

The Web SDK authentication URL redirects after authentication based on the input parameter ReturnUrl.

Important
  • Do not modify the TransactionUrl during the integration process. Doing so will cause a verification exception.

  • The TransactionUrl is for single use only. Reusing it will cause a verification exception.

  • After you obtain the TransactionId or TransactionUrl, you have 30 minutes to complete the verification before the ID or URL expires.

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

Minimal request example

{
  "ProductCode": "eKYC_PRO",
  "MerchantBizId": "e0c34a77f5ac40a*****",
  "MetaInfo": "{\"deviceType\":\"android\"}",
  "MerchantUserId": "user_hash_value",
  "DocType": "GLB03001"
}

Complete request example

{
  "ProductCode": "eKYC_PRO",
  "SceneCode": "1234567890",
  "MerchantBizId": "e0c34a77f5ac40a5aa5e6ed20c35****",
  "MetaInfo": "{\"deviceType\":\"android\",\"zimVer\":\"3.0.0\",\"appVersion\":\"1\",\"appName\":\"com.aliyun.antcloudauth\",\"osVersion\":\"Android 12\",\"deviceModel\":\"Pixel 6\"}",
  "MerchantUserId": "user_hash_value_123",
  "DocType": "GLB03001",
  "Pages": "01,02",
  "Model": "TEMPLATE",
  "DocVideo": "N",
  "FaceAttributeCheck": "N",
  "ShowGuidePage": "1",
  "CallbackUrl": "https://www.aliyun.com/callback",
  "CallbackToken": "NMjvQanQgplBSaEI0sL********",
  "SecurityLevel": "02",
  "Authorize": "F",
  "IdThreshold": "2",
  "IdSpoof": "Y",
  "OcrValueStandard": "0",
  "AutoDocPageConfig": "{\"BRA01001\": \"01\", \"BRA01002\": \"01,02\"}",
  
  "AppQualityCheck": "Y",
  "TemplateConfig": "01,02,07",
  "TemplateType": "Seq",
  "TemplateRanCount": "2",
  "DocScanMode": "shoot"
}

Web SDK

Minimal request example

{
  "ProductCode": "eKYC_PRO",
  "MerchantBizId": "e0c34a77f5ac40a5a*****",
  "MetaInfo": "{\"deviceType\":\"h5\"}",
  "MerchantUserId": "user_hash_value",
  "DocType": "GLB03001",
  "ReturnUrl": "https://example.com/ekyc/callback"
}

Complete request example

{
  "ProductCode": "eKYC_PRO",
  "SceneCode": "1234567890",
  "MerchantBizId": "e0c34a77f5ac40a5aa5e6ed20c35****",
  "MetaInfo": "{\"deviceType\":\"h5\",\"zimVer\":\"3.0.0\",\"appVersion\":\"1\",\"appName\":\"Chrome\",\"osVersion\":\"Windows 10\",\"deviceModel\":\"PC\"}",
  "MerchantUserId": "user_hash_value_123",
  "DocType": "GLB03001",
  "Pages": "01",
  "Model": "PHOTINUS_LIVENESS",
  "DocVideo": "N",
  "FaceAttributeCheck": "N",
  "ShowGuidePage": "1",
  "CallbackUrl": "https://www.aliyun.com/callback",
  "CallbackToken": "NMjvQanQgplBSaEI0sL********",
  "SecurityLevel": "02",
  "Authorize": "F",
  "IdThreshold": "2",
  "IdSpoof": "Y",
  "OcrValueStandard": "0",
  "AutoDocPageConfig": "{\"BRA01001\": \"01\", \"BRA01002\": \"01,02\"}",

  "LanguageConfig": "{\"languageContent\":{},\"ocrResultContent\":{},\"supportedLanguage\":[\"zh-CN\"],\"titleTranslate\":{}}",
  "StyleConfig": "{\"guidepage\":{},\"ocrPage\":{},\"ocrResultPage\":[],\"facePage\":{}}",
  "ShowAlbumIcon": "1",
  "ShowOcrResult": "1",
  "EditOcrResult": "1",
  "ReturnUrl": "https://example.com/ekyc/callback",
  "ProcedurePriority": "url"
}