If a signing relationship exists, you can use this API to query the signing information of the specific order or proactively check the signing status to complete the next step of the service logic. The common application scenarios are as follows:
No signing callback notification is received due to network or server exceptions during payment.
An unknown signing status is returned when the API is called.
Protocol: HTTPS GET
Direction: Your server -> Payment Kit server
URL: https://petalpay-developer.cloud.huawei.com.cn/api/v2/contract/sign/merc-contracts/{mercContractCode}
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. |
| PayMercAuth | Yes | String | The value is a JSON string of PayMercAuth. |
Request Path
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| mercContractCode | Yes | String | Merchant signing contract code. The signing contract code passed when you requests signing is generated by the merchant and must be unique. The value contains a maximum of 64 characters. |
GET /api/v2/contract/sign/merc-contracts/{mercContractCode} HTTP/1.1
Content-Type: application/json;charset=UTF-8
PayMercAuth:
{"callerId":"10132120***","traceId":"202305151047588466083","time":1684118878350,"authId":"120291744647139***","headerSign":"4Xb1tDGRC4f/B58ANI********************znmsDJOALXgvh/RKeReQBbc4lXZp5wnyZmdwTesmPGdszSNP/s=","bodySign":"kf9AZmVjBSGUI2MldsIFShO+Ak00qpPKaXgJo+K********************7gdghaJShhzAsNjt8DE9ulUIlQ0Q95/dZt2jEHcXyLfGNVzDNfFPhvF08NnnGM4="} 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. |
| 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. |
| mercNo | No | String | Merchant number for contract signing. |
| appId | No | String | App ID. |
| contractId | No | String | ID of the withholding contract. |
| mercContractCode | No | String | Merchant signing contract code. The signing contract code passed when you requests signing is generated by the merchant and must be unique. The value contains a maximum of 64 characters. |
| planId | No | String | Contract template ID. The template ID is generated by Huawei Pay when the merchant submits a permission application for withholding to Huawei Pay. |
| signedTime | No | String | Time when a contract is signed, in the format of yyyy-MM-dd hh:mm:ss. |
| expireDate | No | String | Contract expiration time, in the format of yyyy-MM-dd. |
| signStatus | No | String | Signing status. 1: signed 9: contract terminated |
| payer | No | PayerOut | Payer information shown on the client during payment. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"mercContractCode": "2024020316555432***",
"signedTime": "2023-09-01 09:01:25",
"resultCode": "000000",
"sign": "MEUCIQDQ206irxpkVWGQPN*************Dvy1CaNnXaKU+uZBnrJmdhm5aG4JM=",
"contractId": "2024070914615843071097***",
"planId": "1***",
"resultDesc": "success",
"mercNo": "10132120***"
} 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 | CUST_NOT_EXIST | The user does not exist or has been deregistered. | Replace the signing number and try again. |
| 400000 | CHECK_CONTRACT_STATUS | Invalid signing number. | 1. Check whether the signing relationship exists. 2. Check whether the signing number is correct. |