Create To Go Order

POST /o/op/1/order/toGo

Creates a new takeaway or delivery order for a specific business location. See Online Ordering Basics for more details.

application/json

Body Required

  • businessLocationId integer(int64) Required

    The unique identifier of the business location.

  • thirdPartyReference string Required

    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 is 48.

  • endpointId string Required

    Endpoint id for a unique webhook that has been created using the webhook endpoint.

  • customerInfo object Required
    Hide customerInfo attributes Show customerInfo attributes
    • firstName string Required

      Customer first name.

      Minimum length is 1, maximum length is 128.

    • lastName string

      Customer last name.

    • The unique reference for this customer which can help to identify them later on. If the email is left empty, this should be empty as well.

    • email string

      The email address for this customer.

    • The customer phone number in E164 format.

    • notes string

      The notes attached to the customer.

    • Salutation for the customer (Mr., Mrs., Dr., etc...).

    • Update the customer email notification setting.

      Values are ENABLE, DISABLE, or DONT_CHANGE. Default value is DONT_CHANGE.

  • A note added to this order and displayed on the printed dockets.

  • ** 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.

  • A valid account profile code to associate with this order. See the account profiles definition for more details.

  • The time that the order will be sent to the POS. Must be in the future.

  • payment object
    Hide payment attributes Show payment attributes
  • Unique collection code for this order. If left blank, one will be automatically generated.

    Maximum length is 8.

  • The expected collection time of the order. Must be in the future.

  • items array[object]
    Hide items attributes Show items attributes object
    • quantity integer(int32) Required

      Quantity of item to be ordered.

    • sku string Required

      The SKU of the item to be ordered.

      Maximum length is 25.

    • The custom name to be used, if overwriting is permitted for this item.

    • The custom price to be used, if custom pricing is permitted for this item.

    • modifiers array[object]

      Collection of modifiers to be applied to this item.

      Hide modifiers attribute Show modifiers attribute object
    • The discount code being applied to this item, if applicable.

    • subItems array[object]
      Hide subItems attributes Show subItems attributes object
      • quantity integer(int32) Required

        Quantity of sub-item to be ordered.

      • sku string Required

        The SKU of the sub-item to be ordered.

        Maximum length is 25.

      • The custom name to be used if overwriting is supported for this sub-item.

      • The custom price to be used if overwriting is supported for this sub-item.

      • modifiers array[object]

        Collection of modifiers to be applied to this sub-item.

        Hide modifiers attribute Show modifiers attribute object
  • takeAway boolean

    Whether or not this order is for takeaway.

  • The address to which the order should be delivered.

    Hide deliveryAddress attributes Show deliveryAddress attributes
    • The first line of the street address.

    • The second line of the street address (if applicable).

    • zip string

      The postal code for the delivery address.

    • city string

      The city in which the delivery address is located.

Responses

  • 200 application/json

    accepted

    Hide response attribute Show response attribute object
  • 400 application/json

    Bad Request.

    Hide response attributes Show response attributes object
    • timestamp string(date-time)

      The date and time at which the error occurred.

    • status integer

      The HTTP status code of the error response.

    • error string

      A brief title of the error status.

    • message string

      A message describing the nature of the error in detail.

    • errors array[object]

      An array of error details, outlining specific issues with the request.

      Hide errors attributes Show errors attributes object
      • codes array[string]

        A set of code strings that correspond to the validation error.

      • arguments array[object]
        Hide arguments attributes Show arguments attributes object
        • codes array[string]

          Argument codes that are related to the field in validation.

        • The default message associated with the failed validation.

        • code string

          A single code that represents the specific validation rule that was not satisfied.

      • The default error message provided when the associated field fails validation.

      • The name of the object that failed validation.

      • field string

        The name of the field that failed validation.

      • Indicates whether the error was a result of a binding failure.

      • code string

        A code representing the specific type of validation error.

    • path string

      The path of the failed request.

  • 409 */*

    Conflict

    Hide response attributes Show response attributes object
    • status string

      The request status.

    • msg string

      A message describing the error.

POST /o/op/1/order/toGo
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+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"}]}]}],"takeAway":true,"deliveryAddress":{"addressLine1":"string","addressLine2":"string","zip":"string","city":"string"}}'
Request examples
{
  "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+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"
            }
          ]
        }
      ]
    }
  ],
  "takeAway": true,
  "deliveryAddress": {
    "addressLine1": "string",
    "addressLine2": "string",
    "zip": "string",
    "city": "string"
  }
}
Response examples (200)
{
  "status": "ok"
}
Response examples (400)
{
  "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"
}
Response examples (409)
{"status"=>"fail", "msg"=>"reference has already been used 123456789"}