Get Sales
Returns financial data for a business location for a specified date range. Sorted by the timeClosed
field of the sales.
Path parameters
-
The unique identifier for the business location.
Query parameters
-
Start of requested results, in ISO 8601 format.
Based on the timeClosed sales field.
-
to string(date-time)
End of requested results, in ISO 8601 format.
Based on the timeClosed sales field.
If the
to
date is set to a future date or not included, it will be adjusted to the current date and time to retrieve the most recent data available. -
include string
Objects to be included in the response.
The allowed values are:
staff
,table
,consumer
,payments
,revenue_center
,account_profile
,payment_authorization
.Default value is empty.
-
pageSize integer(int32)
Number of entries to return.
Maximum value is
100
. Default value is50
. -
nextPageToken string
A token that indicates the starting point of the next set of records when paginating through results.
Default value is empty.
curl \
-X GET https://api.trial.lsk.lightspeed.app/f/v2/business-location/{businessLocationId}/sales?from=2023-01-01T14%3A00%3A00Z \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"sales": [
{
"accountReference": "57X0j3hzTZ2oo9sdVWiUog==",
"accountFiscId": "A65315.17",
"receiptId": "R65315.13",
"source": {
"initialAccountId": "A65315.13",
"previousAccountId": "A65315.15"
},
"salesLines": [
{
"id": "S65315.33",
"parentLineId": "S65315.32",
"totalNetAmountWithTax": "11.00",
"totalNetAmountWithoutTax": "8.33",
"menuListPrice": "10.00",
"unitCostPrice": "5.00",
"serviceCharge": "1.00",
"serviceChargeRate": "10.00",
"discountAmount": "0.00",
"taxCode": "VAT20",
"taxAmount": "1.6667",
"taxRatePercentage": "20.00",
"taxLines": [
{
"taxId": "41910290874374",
"taxCode": "VAT20",
"taxRate": "1.2",
"taxAmount": "1.666667",
"taxIncluded": true
}
],
"discountType": "DISCOUNT",
"discountCode": "10PCT",
"discountName": "10% Discount",
"accountDiscountAmount": "1.00",
"totalDiscountAmount": "1.00",
"sku": "52",
"name": "Burger",
"statisticGroup": "Food",
"quantity": "1.000",
"accountingGroup": {
"accountingGroupId": 141948669132845,
"name": "Food",
"statisticGroup": "Food",
"code": "123"
},
"currency": "GBP",
"tags": [
"string"
],
"revenueCenter": "Fixed POS",
"revenueCenterId": 141948669132822,
"categories": [
{
"category": "default",
"value": "Food"
}
],
"timeOfSale": "2023-07-27T19:58:22.474Z",
"staffId": 14670,
"staffName": "Manager",
"deviceId": 75125,
"deviceName": "iPad9",
"voidReason": "Unhappy Client",
"accountProfileCode": "AAP"
}
],
"payments": [
{
"code": "CASH",
"description": "Cash",
"paymentMethodId": 141948669132824,
"netAmountWithTax": "11.00",
"currency": "GBP",
"tip": "0.00",
"consumer": {
"id": "ec021fb0-4c12-425e-b30f-320ab720448b",
"customerId": 120913,
"title": "Mr",
"firstName": "John",
"lastName": "Doe",
"phoneNumber1": "555-555-5555",
"phoneNumber2": "555-555-5556",
"companyName": "Company Name",
"addressLine1": "123 Street st.",
"addressLine2": "Unit 123",
"zipCode": "12345",
"city": "Some City",
"state": "Some State",
"email": "example@example.com"
},
"type": "NORMAL",
"deviceId": "72676",
"deviceName": "ipad9",
"staffId": 180480,
"staffName": "Manager",
"authorization": "001",
"externalReference": "1000",
"revenueCenter": "Fixed POS",
"revenueCenterId": 141948669132822,
"fiscId": "T72691.8",
"uuid": "bc7i2X_CTkeg8qlec66wmg==",
"fiscDate": "2023-02-14T20:04:08.665Z",
"surcharge": "0.00"
}
],
"timeOfOpening": "2023-02-14T19:58:48.224Z",
"timeClosed": "2023-02-14T20:04:08.734Z",
"cancelled": false,
"externalFiscalNumber": "IntegratorReferenceId",
"tableNumber": "1",
"tableName": "Dining Room, Table 1",
"accountProfileCode": "AAP",
"ownerName": "Manager",
"ownerId": 14670,
"type": "SALE",
"externalReferences": [
"\"TASK:OO-{businessLocationId}-{unique-reference-code}\", \"TASK:OO-{businessLocationId}-(another-unique-reference-code)\""
],
"nbCovers": 2.0,
"dineIn": true,
"deviceId": 75125,
"deviceName": "ipad9",
"voidReason": "Unhappy Client"
}
],
"nextPageToken": "string"
}
{
"error": "Invalid date format: 12/12/2023"
}
{
"error": "Required request parameter 'from' for method parameter type OffsetDateTime is not present"
}
{
"error": "Invalid date range: 'from' date %s should not be after 'to' date %s"
}
{
"error": "Invalid 'from' date query parameter. The requested business location was not operational on the provided date.\nPlease specify a date and time after: {earliest_date}, which is the earliest available date for this location.\n"
}
{
"timestamp": "2024-05-04T09:42:00+00:00",
"path": "string",
"status": 42,
"error": "string",
"requestId": "string"
}