Search Documentation
Search for a documentation page...
Analytics API
REST API endpoints for store performance metrics and sales over time.
Read store performance metrics. Both endpoints share the same range selector – a preset period (default last 30 days) or an explicit from/to window – and compare figures against the preceding equal-length period to compute growth percentages.
All monetary values (revenue, average order value) are returned in minor units (e.g. cents for USD, pence for GBP). Divide by 100 (or the appropriate factor for the currency) to get the display amount.
Range Parameters
These query parameters apply to every analytics endpoint.
| Parameter | Type | Default | Description |
|---|---|---|---|
period | "today" | "7d" | "30d" | "90d" | "12m" | 30d | Preset window. Ignored when from/to are supplied. |
from | string | – | ISO 8601 start. Overrides period; requires to. |
to | string | – | ISO 8601 end. Overrides period; requires from. |
from and to must be provided together, and from must be before to.
Overview
Headline KPIs for the window: revenue, order count, average order value, new/returning customers, the order-status breakdown, and the top 5 products by revenue. Each top product also carries cogs and coveredUnits – the cost of the units sold and how many of them had a known cost, so a partially costed catalogue is visible rather than silently inflating margin. Revenue, orders, and customer figures include growth versus the preceding equal-length period. Money is in minor units (cents).
Response
Sales
Total revenue and orders for the window, plus a daily series. Each entry in series is a UTC day bucket with date (YYYY-MM-DD), revenue, gross, and orders. revenue is net of refunds and gross is the same bucket before them. Both are in minor units (cents).