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 for 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 object
    • firstName string Required

      Customer first name.

      Minimum length is 1, maximum length is 128.

    • lastName string

      Customer last name.

    • thirdPartyReference string

      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.

    • contactNumberAsE164 string

      The customer phone number in E164 format.

    • notes string

      The notes attached to the customer.

    • salutation string

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

    • emailNotification string

      Update the customer email notification setting.

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

  • 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
    Hide payment attributes Show payment attributes object
    • paymentMethod string

      Payment method code as configured by the merchant.

    • paymentAmount number Required

      The total amount of the payment including tips if any.

    • tipAmount number

      The tip amount, if any.

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

    • customItemName string

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

    • customItemPrice number

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

    • discountAmountOverride number

      The custom discount amount applied to this item. Only one of discountAmountOverride or discountPercentOverride can be set.

    • discountPercentOverride number

      The custom percentage discount applied to this item. Only one of discountAmountOverride or discountPercentOverride can be set.

    • modifiers array[object]

      Collection of modifiers to be applied to this item.

      Hide modifiers attribute Show modifiers attribute object
      • modifierId string

        Modifier ID to be applied to this item.

    • discountCode string

      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.

      • customItemName string

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

      • customItemPrice number

        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
        • modifierId string

          Modifier ID to be applied to this item.

  • deliveryAddress object

    The address to which the order should be delivered.

    Hide deliveryAddress attributes Show deliveryAddress attributes object
    • addressLine1 string

      The first line of the street address.

    • addressLine2 string

      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
    • status string

      The response.

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

        • defaultMessage string

          The default message associated with the failed validation.

        • code string

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

      • defaultMessage string

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

      • objectName string

        The name of the object that failed validation.

      • field string

        The name of the field that failed validation.

      • bindingFailure boolean

        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 \
 --request POST 'https://api.trial.lsk.lightspeed.app/o/op/1/order/toGo' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"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-04-04T09:42:00.000+00:00","payment":{"paymentMethod":"OOPAYMENT","paymentAmount":14.0,"tipAmount":2.0},"collectionCode":"12345","orderCollectionTimeAsIso8601":"2024-04-04T09:42:00.000+00:00","items":[{"quantity":1,"sku":"UGG-BB-PUR-06","customItemName":"My Custom Item Name","customItemPrice":10.0,"discountAmountOverride":5.0,"discountPercentOverride":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"}}'
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-04-04T09:42:00.000+00:00",
  "payment": {
    "paymentMethod": "OOPAYMENT",
    "paymentAmount": 14.0,
    "tipAmount": 2.0
  },
  "collectionCode": "12345",
  "orderCollectionTimeAsIso8601": "2024-04-04T09:42:00.000+00:00",
  "items": [
    {
      "quantity": 1,
      "sku": "UGG-BB-PUR-06",
      "customItemName": "My Custom Item Name",
      "customItemPrice": 10.0,
      "discountAmountOverride": 5.0,
      "discountPercentOverride": 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"
  }
}
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"
}