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

# Analytics

> Revenue, orders, top products and the conversion funnel.

`https://exclusivo.one/api/v1` · scope `analytics:read`

```http theme={"system"}
GET /api/v1/analytics
```

| Parameter    | Values                            | Default |
| ------------ | --------------------------------- | ------- |
| `time_range` | `7d`, `30d`, `90d`, `365d`, `all` | `30d`   |

Anything else returns a `400` listing what's valid.

```bash theme={"system"}
curl "https://exclusivo.one/api/v1/analytics?time_range=90d" \
  -H "Authorization: Bearer ex_live_your_key_here"
```

```json theme={"system"}
{
  "data": {
    "summary": {
      "totalRevenue": 18420.5,
      "totalOrders": 312,
      "averageOrderValue": 59.04,
      "totalCustomers": 244
    },
    "topProducts": [
      { "id": "prod_abc123", "name": "Ceramic Mug", "unitsSold": 84, "revenue": 2352 }
    ],
    "revenueByCategory": [],
    "geographicData": [],
    "revenueTimeSeries": [],
    "orderStatusBreakdown": {},
    "refundAnalytics": {},
    "conversionFunnel": {}
  },
  "timeRange": "90d"
}
```

| Field                  |                                                 |
| ---------------------- | ----------------------------------------------- |
| `summary`              | Revenue, orders, average order value, customers |
| `topProducts`          | **Top 10 only**, by units sold                  |
| `revenueByCategory`    | Split by collection                             |
| `geographicData`       | Revenue by location                             |
| `revenueTimeSeries`    | Revenue over the period                         |
| `orderStatusBreakdown` | Order counts by status                          |
| `refundAnalytics`      | Refund totals and rate                          |
| `conversionFunnel`     | Only present when there's funnel data           |

Two things to code around: `topProducts` is capped at 10 and doesn't paginate —
derive a full breakdown from [orders](/api/store/orders) if you need one. And
`conversionFunnel` is **omitted entirely** rather than returned empty, so check
the key exists before reading it.

## averageOrderValue with no orders

Returned as `0` when `totalOrders` is `0`, rather than erroring. Don't read that
`0` as a meaningful average — check `totalOrders` first.

## Time ranges

`all` covers your whole history and is the most expensive query here. Cache it
rather than calling it on every dashboard load.

## This isn't traffic data

These are commerce numbers — orders, revenue, products. Visits, referrers and
page views live in the dashboard's own analytics and aren't exposed here.

→ [Analytics](/stashed/growth/analytics)

## Errors

| Status |                  |
| ------ | ---------------- |
| `400`  | Bad `time_range` |
| `403`  | Wrong scope      |
| `429`  | Rate limited     |
