# Getting started (/guides/getting-started)

## What the API does [#what]

The TMBill Open API lets your own systems (ERP, accounting, BI, loyalty, head-office dashboards) read a restaurant's TMBill data over HTTPS. Phase 1 is **read-only**: stores, sales totals, item sales and payment modes. The numbers match the TMBill Backoffice day-end report.

## Step by step [#steps]

<Steps>
<Step>
**Ask the restaurant owner for a key**

The owner creates it in **TMBill Backoffice › Settings › API keys**, picks which stores you may read and confirms with a one-time code sent to them. See [Getting a key](/guides/getting-a-key/).
</Step>

<Step>
**Store the key safely**

It is shown once and looks like `tmb_live_AbCd1234_...`. Put it in a secret manager or an environment variable on your server. Never in a browser, mobile app or Git repository.
</Step>

<Step>
**Check the key works**

```bash
curl -H "Authorization: Bearer $TMBILL_KEY" https://openapi.tmbill.com/v1/me
```

You get the key's app, scopes and the stores it can read.
</Step>

<Step>
**List the stores**

```bash
curl -H "Authorization: Bearer $TMBILL_KEY" "https://openapi.tmbill.com/v1/stores?limit=50"
```

Take a `store_id` from the result.
</Step>

<Step>
**Read yesterday's sales**

```bash
curl -sS -H "Authorization: Bearer $TMBILL_KEY" \
  "https://openapi.tmbill.com/v1/sales/summary?store_id=1234&from=2026-12-01&to=2026-12-01"
```

Money comes back as decimal strings, for example `"24890.00"`, with the currency code.
</Step>

<Step>
**Go further**

Item sales, payment modes, report filters and paging: see the guides on the left, or the [API reference](/reference/).
</Step>
</Steps>

<Callout type="info">
**Base URL:** `https://openapi.tmbill.com/v1`. JSON in snake_case, ids are strings, timestamps are ISO-8601 UTC, query dates are the store's business dates (`YYYY-MM-DD`, store local time).
</Callout>