All Products
Search
Document Center

ID Verification:Synchronous call - CREDENTIAL_RECOGNITION

Last Updated:Jun 25, 2026

Call the CredentialRecognition operation to extract key information from credential images and detect forgery. This synchronous operation returns results immediately

API information

  • API operation name: CredentialRecognition

  • Description: Extracts key information from a credential image and detects forgery using AI.

  • Request method: POST

  • Protocol: HTTPS

  • QPS limit: Each API has a dedicated QPS limit. For details, see QPS limits of ID Verification server-side APIs.

  • Endpoints:

    Note
    • Benefits of internal network access: An internal network enables private communication between Alibaba Cloud services in the same region. If your application server is also in the same region, use the internal network endpoint to access the ID Verification service for a more secure and stable connection. 

    • Optimization for overseas access: Network conditions outside the Chinese mainland can be complex. To reduce latency and minimize request failures, optimize your integration by following the best practices in Server-side Network Latency Analysis and Optimization.

    Singapore

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

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

Note
  1. Credential forgery detection is AI-based and achieves 90% accuracy on internal test datasets. Actual accuracy may vary across sample scenarios.

  2. Detection is more effective for native camera images than for digitally synthesized or software-edited images.

  3. Do not rely on forgery detection as the sole verification method. Use it as an auxiliary tool to improve manual review efficiency.

  4. Forgery detection applies to electronic document review scenarios such as financial payment acquisition and e-commerce merchant onboarding. For other scenarios, contact your account manager.

Online debugging and integration

Note

Before you debug or integrate, read the Debug and integrate server-side APIs with OpenAPI guide to understand how to call APIs on the OpenAPI platform and how to obtain the SDK.

You can debug this operation directly in OpenAPI Explorer, and generate SDK sample code for this operation.

Request parameters

Images for the CredentialOcrPictureBase64 or CredentialOcrPictureUrl parameter must meet these requirements:

  • Image format: PNG, JPG, JPEG, BMP, and WebP.

  • Image dimensions: Width and height must each be greater than 15 pixels and less than 8192 pixels. Aspect ratio must be less than 50.

    Note

    For optimal results, use images with width and height greater than 500 pixels.

  • Image size: Maximum 10 MB for CredentialOcrPictureUrl, or 3 MB for CredentialOcrPictureBase64.

    Note

    Large images increase response time. Use images smaller than 3 MB when possible.

Name

Type

Required

Description

Example

ProductCode

string

Yes

The value is fixed to CREDENTIAL_RECOGNITION.

CREDENTIAL_RECOGNITION

CredentialOcrPictureBase64

string

No

The Base64-encoded image. Verify the image size before encoding.

-

CredentialOcrPictureUrl

string

No

The publicly accessible HTTP or HTTPS URL of the image.

https://***

DocType

string

Yes

The credential type:

  • 01: Transaction receipt, including electronic bills such as water, electricity, gas, and credit card bills.

  • 03: Transaction record for a transfer.

01

OcrArea

string

Yes

The extraction type:

  • 0101: Address and name from an electronic bill, extracted through intelligent analysis.

  • 0301: Amount from a transaction record for a transfer.

0101

FraudCheck

string

Yes

Whether to enable tampering detection.

  • true: Enable

  • false: Disable

true

Response parameters

Name

Type

Description

Example

HTTP Status Code

Integer

The HTTP status code.

200

HTTP Body

RequestId

String

The request ID.

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

Result.TransactionId

String

The unique transaction ID.

hksb7ba1b28130d24e015d694361b****

Code

String

Return code: For more information, see Server-side HTTP status codes.

Important
  • Indicates whether the call succeeded.

  • For verification results, check the ResultObject fields.

Success

Message

String

The response message.

success

Result.Success

String

The extraction result:

  • S: Success

  • F: Failed

S

Result.SubCode

String

The verification result description. ResultObject.SubCode error codes.

200

Result.ExtIdInfo

String

JSON format as shown in the example. Result.ExtIdInfo.

  • If the OcrArea request parameter is set to 0101:

    {
      // If tampering detection is enabled (FraudCheck = true), spoofInfo is returned.
      "spoofInfo":
      {
        "spoofResult": "Y",
        "spoofType": "PS,SCREEN_PHOTO,ORIGINAL_PHOTO"
      },
      "recInfo":
      {
        "address": "Yingfeng Street, Xiaoshan District, Hangzhou, Zhejiang Province***",
        "name": "John Doe"
      }
    }
  • If the OcrArea request parameter is set to 0301:

    {
      // If tampering detection is enabled (FraudCheck = true), spoofInfo is returned.
      "spoofInfo":
      {
        "spoofResult": "Y",
        "spoofType": "PS,SCREEN_PHOTO,ORIGINAL_PHOTO"
      },
      "recInfo":
      {
        "money": "$41.41"
      }
    }

ResultObject.SubCode error codes

Error code

Billed

Description and suggestion

200

Yes

Extraction successful.

213

Yes

No text was extracted.

Result.ExtIdInfo

Name

Type

Description

Example

recInfo

String

The extracted key information.

Note

If the extraction fails, this field is empty.

  • If the OcrArea request parameter is set to 0101:

    {
      "address": "Yingfeng Street, Xiaoshan District, Hangzhou, Zhejiang Province, ***",
      "name": "Zhang San"
    }
  • If the OcrArea request parameter is set to 0301:

    {
      "money": "$41.41"
    }

spoofInfo

String

The credential anti-spoofing check result, including risk assessment and risk type:

  • spoofResult:

    • Y: Risk detected

    • N: Normal

  • spoofType:

    • PS: The image was edited with software.

    • SCREEN_PHOTO: The image is a photo of a screen.

    • SCREENSHOT: The image is a screenshot.

    • ORIGINAL_PHOTO: The image is not the original one.

Returned when tampering detection is enabled (FraudCheck is set to true).

{
  "spoofResult": "Y",
  "spoofType": [
    "PS"
  ]
}