All Products
Search
Document Center

ID Verification:InitializeV2

Last Updated:Nov 02, 2026

This topic describes how to initiate an ID_OCR_PRO request by calling the InitializeV2 API operation.

API operation details

  • API operation: InitializeV2

  • Request method: HTTPS POST

  • Description: Before starting an authentication flow, call this API operation to obtain a transactionId. This ID links the API operations in the authentication request.

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

  • Service endpoints:

    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 call this API operation in OpenAPI Explorer to debug the request, and generate SDK code examples.

Integration notes

  • TransactionId return condition: The TransactionId is returned only if the initialization is successful.

  • Authentication validity period: The client must complete the authentication within 30 minutes after obtaining the TransactionId or TransactionUrl.

  • Single use: A TransactionId can be used only once. After an authentication attempt, the ID immediately becomes invalid, regardless of whether the attempt succeeds, fails, or is canceled. An invalid ID cannot be reused to invoke the SDK. To initiate authentication again, you must obtain a new TransactionId from the server-side.

  • TransactionUrl limits: This field is returned only for mobile H5 scenarios. It can be used only once. Do not concatenate, modify, or repeatedly access the URL.

  • Authentication result retrieval: The CallbackUrl notification may be delayed due to network latency. After the client receives the authentication completion notification, it must call the server-side CheckResult API operation to retrieve the final authentication details. Do not rely solely on the callback notification or the result displayed on the page.

  • SDK feature differences: The App SDK and Web SDK have different features. For the Web SDK, there are also minor feature differences between mobile H5 and PC browsers. For details, see the integration documents.

  • Regional limits on certificate types: The supported certificate types vary by deployment region. Before integration, check the certificate type table for your destination region.

Request parameters

Field description

Integration method

Scenario

Initialization API operation response

Request parameters

App SDK

Complete authentication within a native Android or iOS app.

TransactionId, Protocol

Common parameters + App-specific parameters

Web SDK

Authentication in a mobile H5 page or a PC browser.

TransactionId, TransactionUrl, Protocol

Common parameters + Web SDK-specific parameters

The fields are categorized as follows:

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

  • App-specific: Used for the certificate scanning method.

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

Request parameters (Common)

Field

Type

Required

Description

Example

ProductCode

String

Yes

The product plan ID. Set the value to:

ID_OCR_PRO. The user must complete certificate OCR.

Note

The Web SDK supports direct integration. For App integration, only Native SDK version 1.3.9 and later are supported.

ID_OCR_PRO

SceneCode

String

No

A custom authentication scenario ID. You can use this ID to search for records in the console. The ID can be up to 10 characters long and can contain letters, digits, and underscores (_).

1234567890

MerchantBizId

String

Yes

A unique business ID for the merchant. This ID is used for troubleshooting. It can be up to 32 characters long and can contain letters and digits. The server-side does not verify the uniqueness of this ID. The merchant must ensure its uniqueness.

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 ID for the merchant, or another identifier such as a mobile phone number or email address. We recommend that you desensitize or hash this field in advance.

123456789

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. If you set this parameter, it will be returned with the CallbackUrl for anti-replay and tamper-proofing checks.

NMjvQanQgplBSaEI0sL********

IdThreshold

String

No

OCR card quality check:

  • 1: Enable strict mode

  • 2: Enable loose mode (default)

  • 3: Disable

3

IdSpoof

String

No

[OCR configuration] Specifies whether to enable certificate anti-spoofing check:

  • Y: Enabled (default)

  • N: Disabled

To view the output, check Result.ExtIdInfo.ocrIdInfoData.{page}.spoofInfo in the CheckResult response.

N

OcrValueStandard

String

No

[OCR configuration] Specifies whether to return standardized OCR fields:

  • 0: No (default).

  • 1: Yes.

To view the output, check Result.ExtIdInfo.ocrStandardData in the CheckResult response.

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] The certificate pages to collect:

  • 01: Front side (default)

  • 01,02: Front and back sides

Note

Only some certificates support collecting multiple pages. For more information, see the 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"
    }

ShowGuidePage

String

No

[UI configuration] Specifies whether to show the guide page:

  • 1: Show (default).

  • 0: Do not show.

This configuration is not supported in PC browser mode. Supported in Native SDK version 1.2.8 and above.

1

Request parameters (App-specific)

Only the native App SDK supports the following fields.

Field

Type

Required

Description

Example

DocScanMode

String

No

[OCR configuration] The OCR certificate scanning mode:

  • shoot: Take a photo.

  • scan: Scan automatically.

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

This parameter is supported only by Native SDK 1.2.8 and later, and requires the automatic scanning component to be integrated.

shoot

Request parameters (Web SDK-specific)

Only the Web SDK supports the following fields.

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.

{
  "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 album upload entry during the OCR step:

  • 1: Show (default).

  • 0: Do not show.

1

ShowOcrResult

String

No

[OCR configuration] Specifies whether to show the recognition result page during the OCR step:

  • 1: Show (default).

  • 0: Do not show.

1

EditOcrResult

String

No

[OCR configuration] Specifies whether to allow users to edit the OCR recognition result:

  • 1: Allow (default).

  • 0: Do not allow.

1

ReturnUrl

String

Conditionally required

The business redirect URL after authentication ends. This parameter is not required when using iframe embedding mode. It should be provided for non-iframe page redirection scenarios.

https://www.alibabacloud.com

ProcedurePriority

String

No

Specifies whether to allow a fallback method when a compatibility issue occurs during mobile H5 authentication.

  • url: Fallback is supported. The page displays the authentication URL. The user can copy the URL to open it in another browser to continue authentication (default).

  • keep: Fallback is not supported. The system directly returns the error cause and ends the authentication flow. This is not supported on PCs. We recommend setting this to keep for web pages embedded in an app.

url

Response data

Differences in response fields

Field

App SDK

Web SDK

Description

RequestId / Code / Message

Yes

Yes

Common response information.

Result.TransactionId

Yes

Yes

The unique ID for the authentication flow. This field is used for billing and as a request parameter for the CheckResult API operation. We recommend that you bind it with your business ID and store it only on the server-side.

Result.Protocol

Yes

Yes

The standard encrypted protocol for authentication. We recommend that you pass this through to the client SDK. The Web SDK iframe embedding method depends on this field.

Result.TransactionUrl

No

Yes

The Web SDK authentication URL. After authentication, the user is redirected to the ReturnUrl. Do not modify this URL. It can be accessed only once. The authentication must be completed within 30 minutes after you obtain the URL or TransactionId.

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 response code. For more information, see Server-side HTTP status codes.

Success

Message

String

A detailed description of the response 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. After authentication, the user is redirected based on the ReturnUrl request parameter.

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

Minimum request example

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

Complete request example

{
  "ProductCode": "ID_OCR_PRO",
  "MerchantBizId": "e0c34a77f5ac40a5aa5e6ed20c35****",
  "MetaInfo": "{\"deviceType\":\"android\",\"zimVer\":\"3.0.0\",\"appVersion\":\"1\",\"bioMetaInfo\":\"4.1.0:1150****,0\",\"appName\":\"com.aliyun.antcloudauth\",\"osVersion\":\"Android 10\",\"apdidToken\":\"\",\"deviceModel\":\"Pixel 4\"}",
  "MerchantUserId": "123456789",
  "DocType": "GLB03001",
  "SceneCode": "1234567890",
  "CallbackUrl": "https://www.aliyun.com?callbackToken=100000****",
  "CallbackToken": "NMjvQanQgplBSaEI0sL********",
  "IdThreshold": "3",
  "IdSpoof": "N",
  "OcrValueStandard": "0",
  "Pages": "01",
  "ShowGuidePage": "1",
  "DocScanMode": "shoot"
}

Web SDK

Minimum request example

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

Complete request example

{
  "ProductCode": "ID_OCR_PRO",
  "MerchantBizId": "e0c34a77f5ac40a5aa5e6ed20c35****",
  "MetaInfo": "{\"deviceType\":\"h5\",\"zimVer\":\"3.0.0\",\"appVersion\":\"1\",\"bioMetaInfo\":\"4.1.0:1150****,0\",\"appName\":\"com.aliyun.antcloudauth\",\"osVersion\":\"iOS 10.3.2\",\"apdidToken\":\"\",\"deviceModel\":\"iPhone9,1\"}",
  "MerchantUserId": "123456789",
  "DocType": "GLB03001",
  "SceneCode": "1234567890",
  "CallbackUrl": "https://www.aliyun.com?callbackToken=100000****",
  "CallbackToken": "NMjvQanQgplBSaEI0sL********",
  "IdThreshold": "3",
  "IdSpoof": "N",
  "OcrValueStandard": "0",
  "Pages": "01",
  "ShowGuidePage": "1",
  "LanguageConfig": "{\"languageContent\":{},\"ocrResultContent\":{},\"supportedLanguage\":[\"zh\"],\"titleTranslate\":{}}",
  "StyleConfig": "{\"guidepage\":{},\"ocrPage\":{},\"ocrResultPage\":[],\"facePage\":{}}",
  "ShowAlbumIcon": "1",
  "ShowOcrResult": "1",
  "EditOcrResult": "1",
  "ReturnUrl": "https://www.alibabacloud.com",
  "ProcedurePriority": "url"
}