> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnicommerce.sg/llms.txt
> Use this file to discover all available pages before exploring further.

# Sales analytics API

> Sales KPIs, daily trends, channel mix, and top products across marketplaces.

`GET /api/v1/analytics/sales` returns the numbers behind the workspace Orders analysis page, so you can build a sales dashboard in your own app. It requires `analytics:read`.

## Request

```http theme={null}
GET /api/v1/analytics/sales?from=2026-09-01&to=2026-09-30&marketplace=shopee,lazada
```

| Parameter | Description |
| - | - |
| `from`, `to` | Inclusive `YYYY-MM-DD` range. Defaults to the last 30 days, including today. At most 366 days. |
| `marketplace` | Comma-separated marketplaces. |
| `country` | Comma-separated countries. One country selects its currency. |
| `store` | Comma-separated store ids from `GET /api/v1/marketplaces/connected`. |
| `currency` | ISO currency. Defaults to the single country's currency, otherwise SGD. |
| `timeZone` | IANA time zone that defines each day, for example `Asia/Kuala_Lumpur`. Defaults to `Asia/Singapore`. |

Only orders in the selected currency are counted. Amounts are not converted, so call once per currency when you sell in several.

## Response

| Field | Contents |
| - | - |
| `data.filters` | The applied range, filters, `currency`, and `timeZone`. |
| `data.kpis` | `orders`, `netSales`, `aov`, `unitsSold`, return and cancel rates, repeat buyers, and the change for each. |
| `data.dailyTrend` | One point per day with the same day of the previous period for comparison. |
| `data.platformMix` | Orders and net sales per marketplace. |
| `data.statusMix` | Orders and net sales per order status. |
| `data.topProducts` | Up to 40 products ranked by net sales, with SKU and thumbnail. |
| `data.previousFrom`, `data.previousTo` | The comparison period: the same number of days immediately before `from`. |

Change fields such as `netSalesChangePercent` are `null` when the previous period has no sales. Show "—" rather than "+100%".

Repeat-buyer counts are included, but buyers are not listed.

## SDK

```ts theme={null}
const sales = await client.analytics.getSales({
  from: "2026-09-01",
  to: "2026-09-30",
  timeZone: "Asia/Kuala_Lumpur",
});
console.log(sales.data.kpis.netSales, sales.data.filters.currency);
```

```python theme={null}
sales = client.analytics.get_sales(from_="2026-09-01", to="2026-09-30")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.