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

# Get Aggregated Sales

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

## Request

- Base URL: `https://api.trial.lsk.lightspeed.app`
- URL: `https://api.trial.lsk.lightspeed.app/f/finance/{businessLocationId}/aggregatedSales`
- Auth: OAuth 2
  - Authorization code: `https://auth.lsk-prod.app/realms/k-series/protocol/openid-connect/auth`
  - Token URL: `https://auth.lsk-prod.app/realms/k-series/protocol/openid-connect/token` scopes: `financial-api`

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

## Changes

> 31 revisions in range; 1 not diffed.

- **2025-06-22** `12c833108f68`: 1 warning
  - for the `path` request parameter `businessLocationId`, the min was set to `1.00`

[Operation history](https://skmtc.dev/lightspeed/apis/lightspeed-restaurant-k-series-api/changes/f/finance/:businessLocationId/aggregatedSales/get.md)

---

[API](https://skmtc.dev/lightspeed/apis/lightspeed-restaurant-k-series-api.md) - [All operations](https://skmtc.dev/lightspeed/apis/lightspeed-restaurant-k-series-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lightspeed/apis/lightspeed-restaurant-k-series-api/revisions/af001485cf2b?raw)
