Order detail
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
- Query order detail by internal and/or external trade number
- At least one of
tradeNoIn/tradeNoOutmust be provided - After the order is loaded, the order's device must be within the current Token group permission scope
Request URL
https://{GATEWAY_HOST}/third-center-web/openapi/v1/phamboxOrder/orderDetail
Request Method
- POST
Header
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| third-api-token | Yes | string | Access token obtained from the login interface |
Parameters
Request Body:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| tradeNoIn | No* | string | Internal trade number |
| tradeNoOut | No* | string | External trade number |
* At least one of tradeNoIn and tradeNoOut must be non-empty.
Prefer providing one trade number. If both are supplied, tradeNoIn takes precedence and tradeNoOut is not checked. Use records[].tradeNo from List orders as tradeNoOut; do not pass orderId as a trade number.
Response Example
{
"code": 200,
"msg": "success",
"enMsg": null,
"data": {
"id": "ord-10001",
"orgId": "org-001",
"deviceCode": "KIOSK-001",
"payChannelCodeInt": 8001,
"title": "VendBoard Order",
"currency": "USD",
"totalAmount": 1299,
"costAmount": 500,
"discountAmount": 0,
"payAmount": 1299,
"refundAmount": 0,
"isCartOrder": 0,
"tradeNoIn": "IN202607170001",
"tradeNoOut": "OUT202607170001",
"user": "user-openid-001",
"cardNumber": null,
"isRefund": 0,
"tradeStartTime": "2026-07-17 09:59:50",
"payEndTime": "2026-07-17 10:00:00",
"payEndDate": "2026-07-17 00:00:00",
"payStatus": 4,
"phone": null,
"detailList": [
{
"id": "od-1",
"deviceCode": "KIOSK-001",
"aisleCode": "A01",
"showName": "A01",
"tradeNoIn": "IN202607170001",
"goodsId": "goods-001",
"goodsName": "Vitamin C 500mg",
"goodsImgUrl": "https://example.com/images/vitamin-c.jpg",
"goodsThumbnailUrl": "https://example.com/images/vitamin-c-thumb.jpg",
"goodsPurchaseCost": 500,
"payAmount": 1299,
"shipmentAisleCode": "A01",
"shipmentStatus": 1,
"shipmentFailDesc": null,
"shipmentErrCode": null,
"shipmentTime": "2026-07-17 10:00:00"
}
],
"videoList": [],
"ext": null
}
}
Response Parameter Description
Response data: An object when an order is returned. An unknown trade number returns a business error. Check for null before reading fields.
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 |
|---|---|---|
| id | string | Order ID |
| orgId | string | Organization ID |
| deviceCode | string | Device code |
| payChannelCodeInt | int | Payment channel code; see channel codes |
| title | string | Payment title |
| currency | string | Currency code |
| totalAmount | int | Total amount (minor currency unit, e.g. cents) |
| costAmount | int | Cost amount (minor currency unit) |
| discountAmount | int | Discount amount (minor currency unit) |
| payAmount | int | Paid amount (minor currency unit) |
| refundAmount | int | Refund amount (minor currency unit) |
| isCartOrder | int | Whether it is a cart order: 0 no, 1 yes |
| tradeNoIn | string | Internal trade number |
| tradeNoOut | string | External trade number |
| user | string | User identifier |
| cardNumber | string / null | Card number |
| isRefund | int | Whether refunded: 0 no, 1 yes |
| tradeStartTime | string | Trade start date-time; see date format |
| payEndTime | string / null | Payment completion date-time, when available |
| payEndDate | string / null | Payment date; see date format |
| payStatus | int | Payment order status; see the values below |
| phone | string / null | Phone number |
| detailList | array | Order line items |
| detailList[].id | string | Order line ID |
| detailList[].deviceCode | string | Device code for the line |
| detailList[].showName | string | Display name of the aisle |
| detailList[].tradeNoIn | string | Internal trade number |
| detailList[].goodsId | string | Product ID |
| detailList[].goodsName | string | Product name |
| detailList[].goodsImgUrl | string / null | Product image URL, when available |
| detailList[].goodsThumbnailUrl | string / null | Product thumbnail URL, when available |
| detailList[].goodsPurchaseCost | int / null | Product purchase cost in minor currency units, when recorded |
| detailList[].aisleCode | string | Aisle code |
| detailList[].payAmount | int | Line paid amount (minor currency unit) |
| detailList[].shipmentAisleCode | string / null | Actual shipment aisle code, when available |
| detailList[].shipmentStatus | int | Shipment status: 1 succeeded, 2 notification in progress, 64 failed; preserve other codes as unknown |
| detailList[].shipmentFailDesc | string / null | Shipment failure description |
| detailList[].shipmentErrCode | string / null | Shipment error code |
| detailList[].shipmentTime | string / null | Shipment date-time, when available; see date format |
| videoList | array[string] | Order video URL list |
| ext | string / null | Extension field |
Notes
- If both
tradeNoInandtradeNoOutare empty, the API returns a business error. - If the order's device is not within the current Token group permission scope, the API returns a business error (
phambox.scope.deviceNotInScope).
Payment status values
payStatus | Meaning |
|---|---|
| 1 | Pre-created |
| 2 | Unpaid |
| 3 | Payment in progress |
| 4 | Payment succeeded |
| 5 | Payment failed |
| 6 | Cancelled |
| 7 | Waiting for payment notification |
| 8 | Waiting for the door to open |
| 9 | Operation in progress |
| 10 | Awaiting confirmation |
| 11 | Agreement signed |
Payment success does not imply that every line shipped successfully. Check each line's shipmentStatus separately. Retain unrecognized status values for diagnosis rather than mapping them to success.
Payment channel codes
Channel codes include 8001 for external card payments (PAX / Nayax), 11002 for cash and 11005 for MDB member-card payments. Channel configuration can introduce other codes; this is not an exhaustive deployed-channel list. Preserve unknown integers and obtain their meaning from the platform operator. The sample uses 8001 as an illustrative card channel.