Create To Go Order
Creates a new takeaway or delivery order for a specific business location. See Online Ordering Basics for more details.
Body Required
-
The unique identifier for the business location.
-
The external reference provided for this order. Must be unique. This value will be included in the order details sent to the webhook URL.
Minimum length is
1
, maximum length is48
. -
Endpoint id for a unique webhook that has been created using the webhook endpoint.
-
Additional properties are allowed.
-
orderNote string
A note added to this order and displayed on the printed dockets.
-
maxTimeToAttemptOrderDeliverToPos integer(int32)
** Use of this feature is strongly recommended **
Maximum time to attempt delivery of this order to the POS. In milliseconds. The minimum value is 60000ms (1 minute).
If
scheduledTimeForOrderAsIso8601
is used, this value will be added to the scheduled order time. -
staffId integer(int64)
The unique identifier for the staff member.
-
accountProfileCode string
A valid order profile code to associate with this order. See the order profiles definition for more details.
-
scheduledTimeForOrderAsIso8601 string(date-time)
The time that the order will be sent to the POS. Must be in the future.
-
payment object
Additional properties are allowed.
-
collectionCode string
Unique collection code for this order. If left blank, one will be automatically generated.
Maximum length is
8
. -
orderCollectionTimeAsIso8601 string(date-time)
The expected collection time of the order. Must be in the future.
-
items array[object]
-
deliveryAddress object
The address to which the order should be delivered.
Additional properties are allowed.
curl \
-X POST https://api.lsk.lightspeed.app/o/op/1/order/toGo \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"businessLocationId":45454565682155,"thirdPartyReference":"MyAwesomeThirdPartyReference","endpointId":"MY-AWESOME-ENDPOINT-ID","customerInfo":{"firstName":"Jane","lastName":"Doe","thirdPartyReference":"ZEN-7074522d-c71d-403f","email":"jane.doe@example.com","contactNumberAsE164":"+14155552671","notes":"Notes about the customer.","salutation":"Mr.","emailNotification":"DONT_CHANGE"},"orderNote":"Sample Order Note","maxTimeToAttemptOrderDeliverToPos":60000,"staffId":1234567890,"accountProfileCode":"TOGOORDER","scheduledTimeForOrderAsIso8601":"2024-05-04T09:42:00.000+00:00","payment":{"paymentMethod":"OOPAYMENT","paymentAmount":22.01,"tipAmount":2.0},"collectionCode":"12345","orderCollectionTimeAsIso8601":"2024-05-04T09:42:00+00:00","items":[{"quantity":2,"sku":"UGG-BB-PUR-06","customItemName":"My Custom Item Name","customItemPrice":10.0,"modifiers":[{"modifierId":"236025632784492"}],"discountCode":"FIVEPERCENT","subItems":[{"quantity":1,"sku":"ABC-123","customItemName":"My Custom Sub-Item Name","customItemPrice":2.0,"modifiers":[{"modifierId":"236025632784492"}]}]}],"deliveryAddress":{"addressLine1":"string","addressLine2":"string","zip":"string","city":"string"}}'
{
"businessLocationId": 45454565682155,
"thirdPartyReference": "MyAwesomeThirdPartyReference",
"endpointId": "MY-AWESOME-ENDPOINT-ID",
"customerInfo": {
"firstName": "Jane",
"lastName": "Doe",
"thirdPartyReference": "ZEN-7074522d-c71d-403f",
"email": "jane.doe@example.com",
"contactNumberAsE164": "+14155552671",
"notes": "Notes about the customer.",
"salutation": "Mr.",
"emailNotification": "DONT_CHANGE"
},
"orderNote": "Sample Order Note",
"maxTimeToAttemptOrderDeliverToPos": 60000,
"staffId": 1234567890,
"accountProfileCode": "TOGOORDER",
"scheduledTimeForOrderAsIso8601": "2024-05-04T09:42:00.000+00:00",
"payment": {
"paymentMethod": "OOPAYMENT",
"paymentAmount": 22.01,
"tipAmount": 2.0
},
"collectionCode": "12345",
"orderCollectionTimeAsIso8601": "2024-05-04T09:42:00+00:00",
"items": [
{
"quantity": 2,
"sku": "UGG-BB-PUR-06",
"customItemName": "My Custom Item Name",
"customItemPrice": 10.0,
"modifiers": [
{
"modifierId": "236025632784492"
}
],
"discountCode": "FIVEPERCENT",
"subItems": [
{
"quantity": 1,
"sku": "ABC-123",
"customItemName": "My Custom Sub-Item Name",
"customItemPrice": 2.0,
"modifiers": [
{
"modifierId": "236025632784492"
}
]
}
]
}
],
"deliveryAddress": {
"addressLine1": "string",
"addressLine2": "string",
"zip": "string",
"city": "string"
}
}
{
"status": "ok"
}
{
"timestamp": "2023-11-07T19:15:05.043+0000",
"status": 400,
"error": "Bad Request",
"message": "Validation failed for object='toGoOrder'. Error count: 1",
"errors": [
{
"codes": [
"NotNull.toGoOrder.thirdPartyReference",
"NotNull.thirdPartyReference",
"NotNull.java.lang.String",
"NotNull"
],
"arguments": [
{
"codes": [
"toGoOrder.thirdPartyReference",
"thirdPartyReference"
],
"defaultMessage": "thirdPartyReference",
"code": "thirdPartyReference"
}
],
"defaultMessage": "must not be null",
"objectName": "toGoOrder",
"field": "thirdPartyReference",
"bindingFailure": false,
"code": "NotNull"
}
],
"path": "/o/op/1/order/toGo"
}
{
"status": "fail",
"msg": "reference has already been used 123456789"
}