Get Aggregated Sales
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 thefrom
andto
parameters to specify the period. - The
date
parameter specifies a single date for aggregation. - The
from
andto
parameters specify a date-time range and must be used together. - If neither
date
norfrom
/to
are provided it defaults to today's date. - The date range between
from
andto
cannot exceed 365 days (1 year).
Query parameters
-
Specify a single date for which to retrieve aggregated sales data. Cannot be combined with
from
andto
. Use eitherdate
, or bothfrom
andto
. -
Specify the start datetime for the aggregation range. Must be used together with
to
. Cannot be combined withdate
. -
Specify the end datetime for the aggregation range. Must be used together with
from
. Cannot be combined withdate
. -
Default value is
false
. -
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
.
curl \
--request GET 'https://api.trial.lsk.lightspeed.app/f/finance/45454565682155/aggregatedSales?groupBy=string' \
--header "Authorization: Bearer $ACCESS_TOKEN"
{
"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"
}
{
"additionalProperty1": {},
"additionalProperty2": {}
}