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.

Path parameters

Query parameters

  • date string(date)

    The date in YYYY-MM-DD format.

  • from string(date-time)

    Start of requested results, in ISO 8601 format.

    Example:2022-09-21T10:11:56Z or 2022-09-21T06:11:56-04:00

  • to string(date-time)

    End of requested results, in ISO 8601 format.

    Example:2022-09-21T10:11:56Z or 2022-09-21T06:11:56-04:00

  • flattened boolean

    Default value is false.

  • groupBy string Required

    Comma-separated list of parameters to group the results by. The allowed values are: staff, device, deviceId, tag, accountingGroup, and statisticGroup. For example, groupBy can be set to staff,device.

    Minimum length is 3, maximum length is 2147483647.

Responses

  • 200 application/json

    Aggregated sales returned

    Hide response attributes Show response attributes object
    • The groupBy parameter provided.

    • The value that corresponds to the groupBy parameter.

    • The aggregated total of sales for this data set (ex. staff: manager).

    • The aggregated total of service charges for this data set (ex. staff: manager).

    • The aggregated total of discounts for this data set (ex. staff: manager).

    • The aggregated tax total for this data set (ex. staff: manager).

    • The total number of sale lines for this data set (ex. staff: manager).

    • children array[object]
      Hide children attributes Show children attributes object
      • 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 array[object]
        Hide children attributes Show children attributes object
        • The value that corresponds to the second groupBy parameter provided.

        • The aggregated total of sales for this nested data set (ex. staff:manager -> device: iPad7).

        • The aggregated total of service charges for this nested data set (ex. staff:manager -> device: iPad7).

        • The aggregated total of discounts for this nested data set (ex. staff:manager -> device: iPad7).

        • The aggregated tax total for this nested data set (ex. staff:manager -> device: iPad7).

        • The total number of sales for this nested data set (ex. staff:manager -> device: iPad7).

        • children array[object]
          Hide children attributes Show children attributes object
          • children array[object]

            This would continue with as many nested data sets as specified by the groupBy parameters.

            Additional properties are allowed.

  • 400 */*

    Bad Request

    Hide response attribute Show response attribute object
    • * object Additional properties

      Additional properties are allowed.

GET /f/finance/{businessLocationId}/aggregatedSales
curl \
 -X GET https://api.trial.lsk.lightspeed.app/f/finance/{businessLocationId}/aggregatedSales?groupBy=string \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "groupByKey": "staff",
  "groupByValue": "manager",
  "totalAmount": "47.00",
  "serviceCharge": "0.00",
  "totalDiscountedAmount": "0.00",
  "totalTaxAmount": "7.04",
  "numberOfSales": 7.0,
  "children": [
    {
      "groupByKey": "device",
      "children": [
        {
          "groupByValue": "iPad7",
          "totalAmount": "28.00",
          "serviceCharge": "0.00",
          "totalDiscountedAmount": "0.00",
          "totalTaxAmount": "4.19",
          "numberOfSales": 3.0,
          "children": [
            {
              "groupByKey": "string",
              "children": [
                {}
              ]
            }
          ]
        }
      ]
    }
  ],
  "nextStartOfDayAsIso8601": "string",
  "dataComplete": true,
  "businessName": "string"
}
Response examples (400)
{"additionalProperty1"=>{}, "additionalProperty2"=>{}}