Queries details about all orders that are successfully created and paid through Huawei Pay.
If the value of resultCode is 000000, the order is successfully found, but it does not mean that the order is successfully paid. The order status needs to be determined based on the orderStatus field.
This API supports status queries for all Huawei Pay transaction orders. When the one-time payment capability of the Payment Kit is integrated, the payment status of a specific transaction order can be queried using this API. You can also proactively query the transaction order status to complete the next step of the service.
This API needs to be called in the following scenarios:
No callback notification about the payment result is received due to network or server exceptions during payment.
An unknown payment status is returned when the payment API is called.
Protocol: HTTPS GET
Direction: Your server -> Huawei Pay server
URL: https://petalpay-developer.cloud.huawei.com.cn/api/v2/partner/aggr/transactions/orders/{sysTransOrderNo}
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 |
|---|---|---|---|
| sysTransOrderNo | Yes | String | Transaction order number in the Huawei Pay system. After the payment is made, the value is returned to the merchant through the callback notification about the payment result. The value can also be queried using the API for querying order information by mercOrderNo. |
Request Example
GET /api/v2/partner/aggr/transactions/orders/{sysTransOrderNo} HTTP/1.1
Content-Type: application/json;charset=UTF-8
PayMercAuth:
{"callerId":"10132120***","traceId":"202305151047588466083","time":1684118878350,"authId":"120291744647139***","headerSign":"4Xb1tDGRC4f/B58ANIF6sa/Y2p8Eh4EXO7TpmBKrc********************TesmPGdszSNP/s=","bodySign":"kf9AZmVjBSGUI2MldsIFShO+Ak******************lQ0Q95/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. The value 000000 indicates success, and other values indicate failure. |
| 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. |
| sysTransOrderNo | No | String | Transaction order number in the Huawei Pay system. |
| mercOrderNo | Yes | String | Merchant order number, which is generated by the merchant and must be unique. The value contains a maximum of 46 characters. |
| orderStatus | Yes | String | Order status. The options are as follows: - TRX_SUCCESS: The transaction is successful. - TRX_FAILED: The transaction failed. - TRX_APPLY: The transaction is being processed. - TRX_PROC: The transaction is being processed. |
| payload | No | String | Reserved information. If this parameter is passed in a merchant request, it will be returned as-is. |
| currency | Yes | String | Transaction currency. The value contains a maximum of 3 characters. The default value is CNY. Currently, only this currency is supported. |
| totalAmount | Yes | Long | Total order amount, in cents. |
| payerAmount | No | Long | Actual amount paid by the buyer, in cents. |
| promotionAmount | No | Long | Discount amount, in cents. |
| finishTime | No | String | Payment completion time, in UTC format (yyyy-MM-dd'T'HH:mm:ss.SSSZ). |
| paymentTools | No | String | Payment tools. - WECHAT_MICROPAY: WeChat Pay connected through Huawei Pay - AGMT: payment using a debit or credit card based on an agreement - ACCT: account balance - HUAWEIPAY: Huawei Pay |
| promotionDetail | No | List<PromotionItem> | Promotion information, which is returned only when the order is associated with a promotion. |
| spMercNo | No | String | Merchant number of a platform merchant or service provider. The value contains a maximum of 12 characters. |
| subMercNo | No | String | Merchant number of a platform sub-merchant or special merchant. The value contains a maximum of 12 characters. |
| spAppId | No | String | App ID associated with a platform merchant or service provider. |
| subAppId | No | String | App ID associated with a special merchant. Note: The platform sub-merchant ID cannot be bound to an App ID. Passing this parameter in a sub-merchant request may fail the verification. |
| payer | No | PayerOut | Payer information shown on the client during payment. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"resultCode": "000000",
"resultDesc": "Success.",
"sign": "MEQCIH5/3J3onT8qdEQhPZcI2******************HxeAOjIYtSAMtvDH1hRbA4MY861dug==",
"sysTransOrderNo": "12407030857530004914518***",
"mercOrderNo": "czl00120240705***",
"orderStatus": "TRX_SUCCESS",
"payload": "example-payload",
"currency": "CNY",
"totalAmount": 100000,
"payerAmount": 80000,
"promotionAmount": 20000,
"finishTime": "2023-11-28T10:09:01.276+0800",
"paymentTools": "AGMT"
} 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 | PAY_ORDER_NOT_EXIST | The payment order ID does not exist. | Check whether the input order ID is correct. |
| 400000 | MERC_ORDER_NOT_EXIST | The merchant order ID does not exist. | Check whether the input order ID is correct. |
| 400000 | INVALID_MERCNO | Invalid merchant number. | Check whether the input merchant number is correct. |
| 400000 | CHECK_ORDER_STATUS | Order status error. | Check whether this is a duplicate order submission. |