Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
HMS Core
This API is used to query payment orders and refunded orders related to purchase records in a specific period.
Call this API when you want to query the payment orders and refunded orders related to purchase records of the previous day, by setting the start time to 00:00 of the previous day and the end time to 00:00 of the current day.
Order information of the current day may change. Therefore, you are advised to call this API for querying orders of the previous day, instead of the current day.
Protocol | HTTPS POST |
|---|---|
Direction | Developer server -> Huawei IAP server |
URL | {rootUrl}/applications/v1/merchantQuery NOTE The value of rootUrl varies depending on the site. You must select the order service address of the nearest site for access. For details, please refer to Site Information and Site Selection. |
Data Format | Request: Content-Type: application/json Response: Content-Type: application/json |
Request Header
Parameter | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | Yes | String | Value: application/json; charset=UTF-8 |
Authorization | Yes | String | Authentication information, which should contain data generated based on the access token for authentication by the Huawei IAP server. The access token is obtained through the Huawei public API for OAuth 2.0-based authentication. The authentication information format is described in Overview, and for details about how to obtain the access token, please refer to API for Obtaining an App-Level Access Token. |
Request Body
Parameter | Mandatory | Type | Description |
|---|---|---|---|
startAt | Yes | Long | Start time of the specific period. The value is a UTC timestamp, in milliseconds. The value of this parameter cannot be later than the current time. Only orders whose payment time (tradeTime) is later than this parameter value can be queried. |
endAt | Yes | Long | End time of the specific period. The value is a UTC timestamp, in milliseconds. The time difference between this parameter value and the value of startAt should be equal to or less than 48 hours. This parameter value must be greater than the value of startAt. Only orders whose payment time (tradeTime) is earlier than this parameter value can be queried. |
continuationToken | No | String | continuationToken returned in the last query to query the data on the next page. |
POST /applications/v1/merchantQuery
Content-Type: application/json; charset=UTF-8
Authorization: Basic QVQ6Q1YzQ1NPbVlBaGwrZUtRWExtMTBVV2pyWXZHTVF4MmYvcVMya1B0ZElLY3UwaFJrdFNTMmxwdk1FQkIyYldXWGt0REVaR3I4UjFUTTRLMVlmNXdwWU80RG04THdXQWxjaFhEYjBMUjBNTUJtWnFYcGFtazc3THN3UnFJbkhHK28xekdqRzNSMg==
Accept: application/json
Content-Length: 98
{
"startAt": 1666800000000,
"endAt": 1666886400000
} Response Header
Parameter | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | Yes | String | Value: application/json; charset=UTF-8 |
Response Body
Parameter | Mandatory | Type | Description |
|---|---|---|---|
responseCode | Yes | String | Result code. The options are as follows:
|
responseMessage | No | String | Response description. |
orderInfoList | No | JSONArray | List of order information, in JSON format. Each JSONObject indicates the information of an order. For details about the order information format, please refer to the description of OrderInfo. |
continuationToken | No | String | Token to query data on the next page. If a value is returned, pass it in the next query request to query data on the next page. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
orderNo | Yes | String | Huawei order ID. |
requestId | Yes | String | Merchant request ID. |
country | Yes | String | Country or region code, which is used to identify a country or region. The value must comply with the ISO 3166 standard. |
merchantId | Yes | String | Merchant ID. |
applicationId | Yes | String | App ID. |
orderTime | Yes | Long | Time when an order is placed. The value is a UTC timestamp, in milliseconds. |
tradeTime | Yes | Long | Payment time. The value is a UTC timestamp, in milliseconds. |
productId | Yes | String | Product ID. |
productName | Yes | String | Product name. |
payMoney | Yes | String | Payment amount. The unit is dependent on the currency. |
couponAmt | No | String | Coupon amount. The unit is dependent on the currency. |
mpAmt | No | String | Deduction amount converted from bonus points. The unit is dependent on the currency. |
mpRfdAmt | No | String | Refund amount converted from bonus points. The unit is dependent on the currency. |
currency | Yes | String | Currency. |
payType | Yes | Integer | Payment method. For details about its values, please refer to the PayType table at the bottom of the Data Models section. |
tradeState | Yes | Integer | Order status. The options are as follows:
|
tradeType | Yes | String | Transaction type. The options are as follows:
|
oriOrderNo | No | String | ID of the original Huawei order that is refunded, which is returned when tradeType is set to REFUND. |
refundTime | No | Long | Refund time. The value is a UTC timestamp, in milliseconds. |
refundMoney | No | String | Refund amount. The unit is dependent on the currency. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 455
{
"responseCode": "0",
"orderInfoList": [
{
"orderNo": "V202209272021234015A069C79",
"requestId": "20220927202901112349187041.101721234",
"country": "CN",
"merchantId": "9000860001552381234",
"applicationId": "101721234",
"orderTime": 1664281771000,
"tradeTime": 1664281771000,
"productId": "ballcost04",
"productName": "abc",
"payMoney": "10.00",
"couponAmt": "0.10",
"currency": "CNY",
"payType": 4,
"tradeState": 0,
"tradeType": "PURCHASE"
}
],
"continuationToken": "eyJwYWdlU2l6ZSI6MSwicG9zaXRpb24iOiIxNTc2MDczODYzMTQyLjk4MEMzMDFFLjI5MzcifQ=="
} You can use Postman to debug this API online.
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.