> For the complete documentation index, see [llms.txt](https://docs.samesystem.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samesystem.dev/business-guides/sales-and-budget-data/sales-data/retrieve-sales-data.md).

# Retrieve sales data

{% hint style="info" %}
Only available in API v1.
{% endhint %}

You can fetch sales data from all cash registers from the [Weekly balance](/api-v1-reference/weekly-balance/get-weekly-balance-by-date.md) within SameSystem.

You will only receive fields with values. If a field is empty, you will not receive anything regarding the field.

When a date is specified, the API returns data for the full calendar week in which the date falls. The specified date is included in the result.

Information about confirmation of dates (date-time and user) will also be sent to you.

{% hint style="info" %}
You should only use the full clientToken (c-value + d-value), ex. c123d12345, as clientToken in the URL, to be sure that you fetch data from the correct department (d-value). If you only use c-value, it will default to the department where your API user is created.

You can get the clientToken from the [Departments ](/api-v1-reference/departments/list-departments.md)endpoint. The field is called `ctx_token`.
{% endhint %}

### Cash register identification

The response will return an object with register count and registers.

```json
{
    "register_count": 2,
    "registers": []
}
```

`Register_count` will indicate how many cash registers are available for the department. In the example above, the department has 2 cash registers.

The array of register objects will contain information from each register and the total of all registers.

&#x20;Cash register identification

A department/shop can have one or multiple cash registers, each identified by a sequential number (1, 2, 3, etc.).

When receiving sales data, the `register_number` attribute in each `register` object defines what cash register the data belongs to.

`register_number = 0` → total sales from **all** the cash registers

`register_number = 1` → sales from the first cash register

`register_number = 2` → sales from the second cash register

`register_number = 3` → sales from the third cash register

and so on.

&#x20;The `register_number = 0` is always present even though you only have one cash register.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.samesystem.dev/business-guides/sales-and-budget-data/sales-data/retrieve-sales-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
