Skip to main content

Unsold products

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 list of products that had no sales within a specified time range.
  • Candidate products = Phambox products visible to the caller (group scope). Unsold = candidates minus products sold in the time range on the selected device scope.
  • Pagination is passed via URL Query; time range / device filter via Request Body.
  • Optional deviceCode narrows sold statistics and stock aggregation to one device; the candidate product catalog itself is unchanged.

Request URL

  • https://{GATEWAY_HOST}/third-center-web/openapi/v1/phamboxDashboard/productsNotSold?current=1&size=10

Request Method

  • POST

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
third-api-tokenYesOpenAPI access token
X-LocaleNoRecommended: en

Parameters

Send a JSON object as the request body. When using only defaults, send {}; optional fields do not make the body optional.

URL Query:

Parameter NameRequiredTypeDescription
currentNointCurrent page number; default 1
sizeNointNumber of records per page; default 10

Request Body:

Parameter NameRequiredTypeDescription
startTimestampNolongStatistics start time (millisecond timestamp). Default: first day of the current month at 00:00:00 in the statistics service's effective timezone. Supply explicit bounds; see time handling
endTimestampNolongStatistics end time (millisecond timestamp). Default: current time
deviceCodeNostringDevice code. When omitted, sold/stock use all visible devices; when provided, sold/stock use only that device (must be within the caller's visible scope)

Response Example

{
"code": 200,
"msg": "success",
"enMsg": null,
"data": {
"total": 25,
"current": 1,
"size": 10,
"records": [
{
"goodsId": "goods-100",
"productName": "Product A",
"sku": "SKU-EXAMPLE-001",
"price": 5.99,
"total": 100
}
]
}
}

Response Parameter Description

Response data: A pagination object on success. No matches return total: 0 and 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 data:

Parameter NameTypeDescription
totallongTotal number of unsold products
currentlongCurrent page number
sizelongPage size
recordsarrayPage data list
records[].goodsIdstringProduct ID
records[].productNamestringProduct name
records[].skustringSKU
records[].pricedoubleDefault / retail price (USD, major currency unit)
records[].totalintTotal stock quantity across the selected devices

Remarks

  • Results are sorted by total (stock) descending. Pagination accepts current and size; custom sorting is not supported.
  • goodsId and sku are not applied as filters by this endpoint.
  • With an empty device scope, visible catalog products may still be returned as unsold with zero stock. An empty device scope does not necessarily mean an empty product page.
  • Product catalog vs deviceCode:
    • Candidate products always come from the caller's visible Phambox product list (group permission), not filtered by deviceCode.
    • Without deviceCode: a product is "sold" if it sold on any visible device; total is stock across all visible devices.
    • With deviceCode: a product is "sold" only if it sold on that device; total is stock on that device only.
  • Example: product A sold only on device B — without deviceCode, A is not unsold; with deviceCode=C, A can appear as unsold for device C.
  • If deviceCode is outside the caller's visible scope, the request fails with a business permission error.