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
deviceCodenarrows 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
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| third-api-token | Yes | OpenAPI access token |
| X-Locale | No | Recommended: 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 Name | Required | Type | Description |
|---|---|---|---|
| current | No | int | Current page number; default 1 |
| size | No | int | Number of records per page; default 10 |
Request Body:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| startTimestamp | No | long | Statistics 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 |
| endTimestamp | No | long | Statistics end time (millisecond timestamp). Default: current time |
| deviceCode | No | string | Device 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 Name | Type | Description |
|---|---|---|
| total | long | Total number of unsold products |
| current | long | Current page number |
| size | long | Page size |
| records | array | Page data list |
| records[].goodsId | string | Product ID |
| records[].productName | string | Product name |
| records[].sku | string | SKU |
| records[].price | double | Default / retail price (USD, major currency unit) |
| records[].total | int | Total stock quantity across the selected devices |
Remarks
- Results are sorted by
total(stock) descending. Pagination acceptscurrentandsize; custom sorting is not supported. goodsIdandskuare 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;totalis stock across all visible devices. - With
deviceCode: a product is "sold" only if it sold on that device;totalis stock on that device only.
- Candidate products always come from the caller's visible Phambox product list (group permission), not filtered by
- Example: product A sold only on device B — without
deviceCode, A is not unsold; withdeviceCode=C, A can appear as unsold for device C. - If
deviceCodeis outside the caller's visible scope, the request fails with a business permission error.