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

# Store data overview

> Read Store Pulse and sales data as JSON from your server with a private API key.

These read-only endpoints return traffic, funnels, sales, orders and customers as JSON, so you can build your own reports and admin pages.

| Endpoint | Returns | Plan |
| - | - | - |
| [`GET /analytics/headline`](https://docs.khaime.com/api-reference/store-data/headline) | Revenue, visitors, checkouts, conversion rate | Every plan |
| [`GET /analytics/live`](https://docs.khaime.com/api-reference/store-data/live) | Visitors on the website now | Every plan |
| [`GET /analytics/funnel`](https://docs.khaime.com/api-reference/store-data/funnel) | Checkout funnel | Store Pulse |
| [`GET /analytics/sources`](https://docs.khaime.com/api-reference/store-data/sources) | Traffic sources | Store Pulse |
| [`GET /analytics/countries`](https://docs.khaime.com/api-reference/store-data/countries) | Top countries | Store Pulse |
| [`GET /analytics/products`](https://docs.khaime.com/api-reference/store-data/products) | Product performance | Store Pulse |
| [`GET /analytics/sales`](https://docs.khaime.com/api-reference/store-data/sales) | Sales summary | Every plan |
| [`GET /analytics/orders`](https://docs.khaime.com/api-reference/store-data/list-orders) | Orders | Every plan |
| [`GET /analytics/orders/{order_id}`](https://docs.khaime.com/api-reference/store-data/get-order) | One order | Every plan |
| [`GET /analytics/customers`](https://docs.khaime.com/api-reference/store-data/list-customers) | Customers and spend | Every plan |

## Keys

Send a private key in the `X-API-Key` header. See [Authentication](https://docs.khaime.com/api-reference/authentication.md).

> [!WARNING]
>
> This data is private. Call these endpoints only from your server. Never put a `pk_` key in browser code. A public store key (`pub_live_` or `pub_sandbox_`) is refused.

The key decides the business and the environment. A `pk_live_` key reads live sales, and a `pk_sandbox_` key reads test sales. Every response has an `environment` field. No parameter or header changes either value.

A marketplace operator's Store Pulse figures include its active sub-merchants, as they do on the dashboard. Its sales, orders and customers cover its own business only.

## Empty is not zero

A value that nothing measures is `null`, never 0. Show "not tracked" or "not measurable" instead of a number.

| Field | Meaning |
| - | - |
| `tracked: false` | No tracker is measuring this. See [Store Pulse for API integrations](https://docs.khaime.com/store-pulse/api-integrations.md). |
| `conversion_rate: null` | Visits cannot be matched to orders yet. |
| `change_percent: null`, `*_change_pct: null` | The previous period was empty. |
| `percent_of_visits: null` | There were no visits, or the step is not tracked. |
| `amount: null` | The order has no recorded amount. |

## Money

* Store Pulse amounts, `amount.minor` and `totals[].minor` are in hundredths of their currency. Divide by 100 to show them.
* Sales summary fields ending in `_usd` and its `revenue_by_day` amounts are whole US dollars.
* Currencies are never added together.

## Errors

Every error has a stable `error_code`. Switch on the code, not the message.

| Status | `error_code` | When |
| - | - | - |
| `400` | `VALIDATION_FAILED` | A parameter is wrong |
| `401` | `API_KEY_MISSING` | No `X-API-Key` header |
| `401` | `API_KEY_INVALID` | The key is unknown or deactivated, or it is a `pub_` key |
| `403` | `BUSINESS_FEATURE_UNAVAILABLE` | Store Pulse is not on the business's plan |
| `404` | `ORDER_NOT_FOUND` | No such order for this business in this environment |
| `429` | `API_KEY_RATE_LIMITED` | The key passed its hourly limit. `retry_after` gives the seconds to wait |
| `500`, `503` | `INTERNAL_ERROR` | Try again shortly |

Requests count against the key's hourly limit, so cache responses on your server. A minute is enough for most pages.


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