Skip to main content

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 / tradeNoOut must 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
Parameter NameRequiredTypeDescription
third-api-tokenYesstringAccess token obtained from the login interface

Parameters

Request Body:

Parameter NameRequiredTypeDescription
tradeNoInNo*stringInternal trade number
tradeNoOutNo*stringExternal 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 NameTypeDescription
idstringOrder ID
orgIdstringOrganization ID
deviceCodestringDevice code
payChannelCodeIntintPayment channel code; see channel codes
titlestringPayment title
currencystringCurrency code
totalAmountintTotal amount (minor currency unit, e.g. cents)
costAmountintCost amount (minor currency unit)
discountAmountintDiscount amount (minor currency unit)
payAmountintPaid amount (minor currency unit)
refundAmountintRefund amount (minor currency unit)
isCartOrderintWhether it is a cart order: 0 no, 1 yes
tradeNoInstringInternal trade number
tradeNoOutstringExternal trade number
userstringUser identifier
cardNumberstring / nullCard number
isRefundintWhether refunded: 0 no, 1 yes
tradeStartTimestringTrade start date-time; see date format
payEndTimestring / nullPayment completion date-time, when available
payEndDatestring / nullPayment date; see date format
payStatusintPayment order status; see the values below
phonestring / nullPhone number
detailListarrayOrder line items
detailList[].idstringOrder line ID
detailList[].deviceCodestringDevice code for the line
detailList[].showNamestringDisplay name of the aisle
detailList[].tradeNoInstringInternal trade number
detailList[].goodsIdstringProduct ID
detailList[].goodsNamestringProduct name
detailList[].goodsImgUrlstring / nullProduct image URL, when available
detailList[].goodsThumbnailUrlstring / nullProduct thumbnail URL, when available
detailList[].goodsPurchaseCostint / nullProduct purchase cost in minor currency units, when recorded
detailList[].aisleCodestringAisle code
detailList[].payAmountintLine paid amount (minor currency unit)
detailList[].shipmentAisleCodestring / nullActual shipment aisle code, when available
detailList[].shipmentStatusintShipment status: 1 succeeded, 2 notification in progress, 64 failed; preserve other codes as unknown
detailList[].shipmentFailDescstring / nullShipment failure description
detailList[].shipmentErrCodestring / nullShipment error code
detailList[].shipmentTimestring / nullShipment date-time, when available; see date format
videoListarray[string]Order video URL list
extstring / nullExtension field

Notes

  • If both tradeNoIn and tradeNoOut are 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

payStatusMeaning
1Pre-created
2Unpaid
3Payment in progress
4Payment succeeded
5Payment failed
6Cancelled
7Waiting for payment notification
8Waiting for the door to open
9Operation in progress
10Awaiting confirmation
11Agreement 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.