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
-
businessLocationId integer(int64) Required
ID of the business location
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
or2022-09-21T06:11:56-04:00
-
to string(date-time)
End of requested results, in ISO 8601 format
Example:
2022-09-21T10:11:56Z
or2022-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
, andstatisticGroup
.
For example,groupBy
can be set tostaff,device
.Minimum length is
3
, maximum length is2147483647
.
GET /f/finance/{businessLocationId}/aggregatedSales
curl \
-X GET https://api.trial.lsk.lightspeed.app/f/finance/45454565682155/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"
}