Sales trend
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
- Retrieve line chart data for sales figures across the current period and the comparison period.
- Used for displaying trend comparisons.
- Aggregated by day, not by hour. Missing sales dates within the requested range are filled with zero amounts.
Request URL
https://{GATEWAY_HOST}/third-center-web/openapi/v1/phamboxDashboard/totalSalesTrend
Request Method
- POST
Parameters
Send a JSON object as the request body. When using only defaults, send {}; optional fields do not make the body optional.
Request Body:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| startTimestamp | No | long | Start time of the current period (timestamp in milliseconds) |
| endTimestamp | No | long | End time of the current period (timestamp in milliseconds) |
| compareStartTimestamp | No | long | Start time of the comparison period (timestamp in milliseconds) |
| compareEndTimestamp | No | long | End time of the comparison period (timestamp in milliseconds) |
Supply both comparison bounds together. If either comparison bound is absent, comparePeriod is []; there is no automatic previous-period comparison. See time handling for defaults and timezone limitations.
Response Example
{
"code": 200,
"msg": "success",
"enMsg": null,
"data": {
"currentPeriod": [
{
"time": "2026-04-17",
"amount": 1234.56
},
{
"time": "2026-04-18",
"amount": 987.65
}
],
"comparePeriod": [
{
"time": "2026-03-17",
"amount": 1100
},
{
"time": "2026-03-18",
"amount": 850.3
}
]
}
}
Response Parameter Description
Response data: object containing currentPeriod and comparePeriod arrays on success. An unused comparison period is an empty array.
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 |
|---|---|---|
| currentPeriod | array | List of data points for the current period |
| comparePeriod | array | List of data points for the comparison period |
| *.time | string | Daily date label (yyyy-MM-dd, e.g., 2026-04-17), not an hourly timestamp |
| *.amount | double | Sales amount (USD, rounded to two decimal places) |