Skip to main content

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 NameRequiredTypeDescription
startTimestampNolongStart time of the current period (timestamp in milliseconds)
endTimestampNolongEnd time of the current period (timestamp in milliseconds)
compareStartTimestampNolongStart time of the comparison period (timestamp in milliseconds)
compareEndTimestampNolongEnd 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 NameTypeDescription
currentPeriodarrayList of data points for the current period
comparePeriodarrayList of data points for the comparison period
*.timestringDaily date label (yyyy-MM-dd, e.g., 2026-04-17), not an hourly timestamp
*.amountdoubleSales amount (USD, rounded to two decimal places)