List orders
Applies to: API integrators with third-party API access.
Use Content-Type: application/json and optionally X-Locale: en. The third-api-token header is required. See common headers and error handling.
Brief Description
- Paginated query for the order list of a single device
deviceCodeis required; optionaltradeNofilters by external trade number (tradeNoOut)- Pagination is passed via URL Query (
current/size); filter conditions are passed via Request Body includeHistorycontrols whether archived historical orders are included:false(default): query current orders onlytrue: query both current and archived orders
- Data scope follows the user identity and
groupIdassociated with the Token; the device must be within the current permission scope - Results are sorted by business time descending (prefer
pay_end_timestamp; fall back totrade_start_timestamp)
Request URL
https://{GATEWAY_HOST}/third-center-web/openapi/v1/phamboxOrder/queryOrderList?current=1&size=10
Request Method
- POST
Header
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| third-api-token | Yes | string | Access token obtained from the login interface |
Parameters
URL Query:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| current | No | int | Current page number; default is 1 |
| size | No | int | Number of records per page; default is 10 |
Request Body:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| deviceCode | Yes | string | Device code |
| tradeNo | No | string | External trade number (tradeNoOut); leave empty to query by device only |
| includeHistory | No | boolean | Whether to include archived historical orders. Default is false (current orders only). Set to true to also query archived orders |
Response Example
{
"code": 200,
"msg": "success",
"enMsg": null,
"data": {
"total": 35,
"current": 1,
"size": 10,
"records": [
{
"orderId": "ord-10001",
"orgId": "org-001",
"deviceCode": "KIOSK-001",
"payChannelCodeInt": 8001,
"totalAmount": 1299,
"tradeNo": "OUT202607170001",
"userId": "user-openid-001",
"detailVOList": [
{
"aisleCode": "A01",
"goodsId": "goods-001",
"goodsName": "Vitamin C 500mg",
"payAmount": 1299,
"shipmentAisleCode": "A01",
"shipmentStatus": 1,
"shipmentFailDesc": null,
"shipmentErrCode": null,
"shipmentTime": "2026-07-17 10:00:00"
}
]
}
]
}
}
Response Parameter Description
Response data: A pagination object on success. An empty result keeps the pagination wrapper with records: [].
Errors: data may be null, a string or an array of messages. Check the HTTP status and code before reading success data. See error handling.
Response:
| Parameter Name | Type | Description |
|---|---|---|
| total | long | Total number of matching orders |
| current | long | Current page number |
| size | long | Page size |
| records | array | Order list of the current page |
| records[].orderId | string | Order ID |
| records[].orgId | string | Organization ID |
| records[].deviceCode | string | Device code |
| records[].payChannelCodeInt | int | Payment channel code; see channel codes |
| records[].totalAmount | int | Total amount (minor currency unit, e.g. cents) |
| records[].tradeNo | string | External trade number (tradeNoOut) |
| records[].userId | string | User identifier |
| records[].detailVOList | array | Order line items |
| records[].detailVOList[].aisleCode | string | Aisle code |
| records[].detailVOList[].goodsId | string | Product ID |
| records[].detailVOList[].goodsName | string | Product name |
| records[].detailVOList[].payAmount | int | Paid amount (minor currency unit) |
| records[].detailVOList[].shipmentAisleCode | string | Shipment aisle code |
| records[].detailVOList[].shipmentStatus | int | Shipment status: 1 succeeded, 2 notification in progress, 64 failed; preserve other codes as unknown |
| records[].detailVOList[].shipmentFailDesc | string / null | Shipment failure description |
| records[].detailVOList[].shipmentErrCode | string / null | Shipment error code |
| records[].detailVOList[].shipmentTime | string / null | Shipment time, when available; see date format |
Notes
- If
deviceCodeis missing or blank, the API returns a business error. - If the device is not within the current Token group permission scope, the API returns a business error (
phambox.scope.deviceNotInScope). - If
current/sizeare omitted, the API defaults to page1with size10. - If
includeHistoryis omitted ornull, it is treated asfalse(current orders only). - Breaking change vs previous API:
datais now a pagination object (total/current/size/records) instead of{ "list": [...] }. Read items fromdata.records.