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

# Merchant analytics

> Bearer-authenticated analytics for widgets and integrations.

All routes require:

```txt theme={null}
Authorization: Bearer mk_live_<your_key>
```

Neither route reads the query string. Extra query parameters are ignored, not rejected. Windows are fixed in the loader.

## Widget metrics

```http theme={null}
GET /api/merchant/v1/stores/{storeId}/analytics
```

Scope: `widget:read`. Ceiling `viewOrders`.

```json theme={null}
{
  "revenue": 0,
  "revenueChange": 0,
  "orders": 0,
  "ordersChange": 0,
  "customers": 0,
  "customersChange": 0
}
```

| Field | Type | Meaning |
| - | - | - |
| `revenue` | number | All-time sum of order `price`. No status filter |
| `revenueChange` | number | Percent change of revenue in the last 30×24 hours versus the previous 30×24 hours. `0` when the previous window is `0` |
| `orders` | number | Order count in the last 30×24 hours. No status filter |
| `ordersChange` | number | Percent change of that count versus the previous 30×24 hours. `0` when the previous window is `0` |
| `customers` | number | All-time count of distinct lowercased customer emails |
| `customersChange` | number | Always `0` |

A store with no orders returns zeros for every field. Visitor, conversion, top-product, and payment-method stats from the home loader are not included.

## Chart

```http theme={null}
GET /api/merchant/v1/stores/{storeId}/analytics/chart
```

Scope: `analytics:read`. Ceiling `viewAnalytics`.

The query string is ignored. There is no `range`, `days`, `from`, or `to` parameter.

```json theme={null}
{
  "chart": [
    { "date": "2026-09-15", "revenue": 120, "orders": 3 }
  ]
}
```

| Field | Type | Meaning |
| - | - | - |
| `chart` | array | Empty when the store has no orders. Otherwise 30 points: today and the previous 29 server-local calendar days, including days with no orders |
| `chart[].date` | string | Server-local `YYYY-MM-DD` |
| `chart[].revenue` | number | Sum of order `price` that day. No status filter |
| `chart[].orders` | number | Order count that day. No status filter |

## Errors

| Status | Meaning |
| - | - |
| 401 | Missing, invalid, expired, or revoked token |
| 403 | Scope or shop not allowed for this key |
| 429 | Rate limit exceeded (120 requests per 60 seconds) |

## Related

* [Merchant store](https://docs.joinmarkt.com/api-reference/merchant-store.md)
* [API keys](https://docs.joinmarkt.com/developers/api-keys.md)
* [Authentication](https://docs.joinmarkt.com/api-reference/authentication.md)


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