Before accessing the real-name verification service, you need to call this API to obtain the pre-verification ID (preVerifyId) and return it to the client. The client then calls the verification API to display the real-name verification screen of Huawei Pay.
Protocol: HTTPS POST
Direction: Your server -> Payment Kit server
URL: https://petalpay-developer.cloud.huawei.com.cn/api/v1/realname/verification/preverify
Data format:
Request: Content-Type: application/json; charset=UTF-8
Response: Content-Type: application/json; charset=UTF-8
Request Header
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | The value is application/json; charset=UTF-8. |
| PayDevAuth | Yes | String | The value is a JSON string of PayDevAuth. |
Request Body
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| credentialType | Yes | String | Certificate type. 01: ID card |
| credentialIdNo | Yes | String | ID number encrypted using SHA-512. The value contains a maximum of 128 characters. |
| realName | Yes | String | User name encrypted using SHA-512. The value contains a maximum of 128 characters. |
| openId | Yes | String | OpenID of a user. For details, see Obtaining User Information. The value contains 1 to 512 characters. Note: The real-name information in the input parameter must be the same as that of the user identified by the OpenID. |
POST /api/v1/realname/verification/preverify HTTP/1.1
Content-Type: application/json;charset=UTF-8
PayDevAuth: {"clientId":"10132120***","accessToken":"DQEBALZh0tlSKKiNDJ9lYYg0Du0EB3E6PvcGlFsyB*******************XR+k2EX8ry1IGdDUZG1PjfcWQ94xnK7w3ag==","traceId":"202305151026422776499","time":1684117602555, "developerSignKeyId":"76e5ee072756417a829201fa********************f9a292d23ca949202c3dac548120", "petalpaySignKeyId":"DEVELOPER_SIGN_EB48251AC36***", "headerSign":"u+H3F14Oe3fS34d32S9mGCES89XA7tSjp8+********************lOGS7eADFfw2E45WJu52vY5Ku4KGcSCnSeE6DiKs=", "bodySign":"y3DFDtDLXDBqDoItDgHmFJ343H57LKH6U5G7F/*******************asPj10iDUIFeHaszDFHpiHRT23LGHaxvHJKta6J5UxIUmApL+wGdV/juGEvQ="}
Accept: application/json
{
"credentialType": "01",
"credentialIdNo": "a27aad63294be3fbb164e3d3d4634956cc6dc7427860*******************87798851b9fcd0f828ba78cfd99bf3d64bfa83815659e989f50d537",
"realName": "a24374f8658456db7a20cb73001f28f886c31232097bda8*******************ecbb12eb7db7edb57c507ebefdea4ab66f8f2f6acc835355fbef7299c5c48806a",
"openId": "88e9eae22447d7a138357cbf0af2d9a3a84819ec18419631c*******************2b9cc4e33ad29e2048318b47ec98be41cecdd4e153e6216a6bd60851"
} Response Header
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | The value is application/json; charset=UTF-8. |
Response Body
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| resultCode | Yes | String | Result code. 000000 indicates success, and other values indicate exceptions. For details, see Result Codes. |
| resultDesc | Yes | String | Result description. |
| subCode | No | String | Service result code. |
| subDesc | No | String | Service result description. |
| sign | Yes | String | Signature, which is used to perform anti-tamper verification on response packets. |
| preVerifyId | Yes | String | Pre-verification ID. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"resultCode": "000000",
"resultDesc": "Success.",
"sign": "MEQCIEIWzdpziRyTi8vhwWHFu********************0YAMabeCgTDG77e+2XJItvq/ZkIcCN5/B20pQ==",
"preVerifyId": "12407091401520894056950***"
} For error codes of resultCode other than 400000, see Common Result Codes.
| Return Code | Result Code | Description | Solution |
|---|---|---|---|
| 400000 | UNKNOW_ERROR | Service temporarily unavailable. Try again later. | Try again later. |
| 400000 | INVALID_ARGUMENTS | Invalid parameter. | Check the request parameters. |
| 400000 | CLIENT_ID_PARAM_ERROR | Client ID error. | Check whether the clientId parameter in the request header is correct. |
| 400000 | INVALID_OPENID | OpenID error. | Check whether the input parameter openId in the request is correct. |
| 400000 | DAILY_LIMIT_EXCEEDED | The number of service calls has exceeded the daily limit. Try again the next day or contact the developer. | Try again the next day. |
| 400000 | ID_TYPE_NOT_SUPPORT | Unsupported certificate type. | Check whether the input parameter in the request is correct and the value is an enumerated value of the parameter. |
| 400000 | RARE_CHARACTERS_NOT_SUPPORTED | Rare characters are not supported. | Check the request parameters. |