---
title: "Get Aggregated Sales"
method: GET
path: "/f/finance/{businessLocationId}/aggregatedSales"
tags: ["Financial"]
---

# Get Aggregated Sales

`GET /f/finance/{businessLocationId}/aggregatedSales`

Get sales for the current business day or the specified date range, aggregated by one or more values.
The values are specified in the `groupBy` parameter and are nested in the order provided in the request.

- Use either the `date` parameter **or** the `from` and `to` parameters to specify the period.
- The `date` parameter specifies a single date for aggregation.
- The `from` and `to` parameters specify a date-time range and must be used together.
- **If neither `date` nor `from`/`to` are provided it defaults to today's date**.
- The date range between `from` and `to` cannot exceed 365 days (1 year).

## Path parameters

- `businessLocationId` integer, required

## Query parameters

- `date` string, date
- `from` string, date-time
- `to` string, date-time
- `flattened` boolean
- `groupBy` string, required

## Response `200`

Aggregated sales returned

- object
  - `groupByKey` string — The groupBy parameter provided.
  - `groupByValue` string — The value that corresponds to the groupBy parameter.
  - `totalAmount` string — The aggregated total of sales for this data set (ex. `staff: manager`).
  - `serviceCharge` string — The aggregated total of service charges for this data set (ex. `staff: manager`).
  - `totalDiscountedAmount` string — The aggregated total of discounts for this data set (ex. `staff: manager`).
  - `totalTaxAmount` string — The aggregated tax total for this data set (ex. `staff: manager`).
  - `numberOfSales` number — The total number of sale lines for this data set (ex. `staff: manager`).
  - `children` object[]
    - `groupByKey` string — The second groupBy parameter provided, if applicable. The parameters will be nested based on the order provided. For example, `staff,device` will show totals for each `staff` value, and then those totals broken down by `device`.
    - `children` object[]
      - `groupByValue` string — The value that corresponds to the second groupBy parameter provided.
      - `totalAmount` string — The aggregated total of sales for this nested data set (ex. `staff:manager -> device: iPad7 `).
      - `serviceCharge` string — The aggregated total of service charges for this nested data set (ex. `staff:manager -> device: iPad7 `).
      - `totalDiscountedAmount` string — The aggregated total of discounts for this nested data set (ex. `staff:manager -> device: iPad7 `).
      - `totalTaxAmount` string — The aggregated tax total for this nested data set (ex. `staff:manager -> device: iPad7 `).
      - `numberOfSales` number — The total number of sales for this nested data set (ex. `staff:manager -> device: iPad7 `).
      - `children` object[]
        - `groupByKey` string
        - `children` object[] — This would continue with as many nested data sets as specified by the groupBy parameters.
  - `nextStartOfDayAsIso8601` string
  - `dataComplete` boolean
  - `businessName` string

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/lightspeed/apis/lightspeed-restaurant-k-series-api.md) · [All operations](https://skmtc.net/lightspeed/apis/lightspeed-restaurant-k-series-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lightspeed/lightspeed-restaurant-k-series-api/revisions/96f04e4e3f61/schema)
