Show Proposed Order

Order Ahead / Endpoints

Show a Proposed Order Ahead Order

This endpoint shows the current status of a proposed order ahead order. After starting an order, the client should poll this endpoint (at most once per second) until it no longer responds with HTTP 202 Accepted.

Clients should not need to construct this URL themselves. It is returned from the Start an Order Ahead Order endpoint as order_url.

When the user is ready to check out, POST to order_completion_url. Only then will the user be charged and their order forwarded to the third-party order ahead provider. (See Complete an Order Ahead Order for more detail.)

Request Endpoint

GET /v15/order_ahead/orders/:uuid

Authorization

A user token with the create_orders and read_user_basic_info permissions is required for this request.

cURL Example

curl https://api.thelevelup.com/v15/order_ahead/orders/f7943600849501323c1552668b2aa48c \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token user="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"'

Response

When the order is still being processed:

HTTP 202 Accepted (Empty response body)

When the order is ready for the client: HTTP 200 OK

{
  "order": {
    "allows_special_instructions": true,
    "available_at": [
      "2016-03-25T15:20:00Z",
      "2016-03-25T15:40:00Z",
      "2016-03-25T16:00:00Z",
      "2016-03-25T16:20:00Z",
      "2016-03-25T16:40:00Z",
      "2016-03-25T17:00:00Z",
      "2016-03-25T17:20:00Z",
      "2016-03-25T17:40:00Z",
      "2016-03-25T18:00:00Z"
    ],
    "discount_amount": 100,
    "instructions": "Pick up your food at the counter.",
    "items": [
      {
        "item": {
          "id": 103,
          "name": "Carne Asada Burrito",
          "option_ids": [525, 527],
          "price_amount": 1000,
          "quantity": 1,
          "selected_options": [
            {
              "option": {
                "id": 525,
                "name": "Flour Tortilla",
                "price_amount": 0,
                "quantity": 1
              }
            },
            {
              "option": {
                "id": 527,
                "name": "Green Salsa",
                "price_amount": 75,
                "quantity": 2
              }
            }
          ],
          "selected_options_description": "Flour Tortilla, Green Salsa (Quantity: 2)",
          "special_instructions": "Double wrap please."
        }
      }
    ],
    "latitude": 42.3557498,
    "location_id": 1855,
    "location_subtitle": "Boston, MA 02110",
    "location_title": "1 Federal St",
    "order_completion_url": \
      "https://api.thelevelup.com/v15/users/orders/1a2b3.../complete",
    "service_fee_amount": 45,
    "soonest_available_at": "2016-03-25T15:08:00Z",
    "special_instructions_character_limit": 100,
    "spend_amount": 1150,
    "state": "externally_valid",
    "tax_amount": 45,
    "tip_amount": 0,
    "total_amount": 1240,
    "uuid": "1a2b3c4d5e6f7g8h9i9h8g7f6e5d4c3b2a1"
  }
}

Response Parameters

Name Type Description
available_at Array of Strings ISO8601-formatted timestamps representing times when the order can be requested to be ready.
discount_amount Integer Total in cents of discounts available through LevelUp. This includes gift card credit. Never null.
instructions String, null Instructions specific to the pickup or delivery process.
items Array of objects The items ordered by the user.
item[id] Integer The item’s menu ID.
item[name] String The item’s name.
item[option_ids] Array of Integers An array of option IDs included with the item.
item[price_amount] Integer The items price.
item[quantity] Integer The quantity ordered by the user.
item[selected_options] Array of objects An array of options for the item. Properties include the option’s menu ID, name, price, and quantity.
item[selected_options_
description]
String A human-readable description of the options selected by the user, if any. May be an empty string, but will never be null.
item[special_instructions] String, null Any special instructions for the item.
latitude Decimal The latitude of the merchant location.
location_id Integer The ID of the location at which the order was fulfilled.
location_subtitle String The merchant location’s subtitle, as displayed in the LevelUp app’s Places screen. Usually the location’s city, state and ZIP.
location_title String The merchant location’s title, as displayed in the LevelUp app’s Places screen. Usually the location’s street address.
order_completion_url String POST to this URL to complete an order. Never null.
service_fee_amount Integer The service fee charged to the user in cents. Will be null if the app does not charge a service fee.
soonest_available_at String ISO8601-formatted timestamp representing the soonest time at which the order can be prepared or delivered. (In other words, this is what “ASAP” means.) Never null.
spend_amount Integer Subtotal of order in cents. Never null.
allows_special_instructions boolean Defines whether special instructions are allowed to be submitted with the order
special_instructions_
character_limit
integer Defines the number of characters of special instructions allowed
state String The order’s state. Never null.
tax_amount Integer Tax in cents. Never null.
tip_amount Integer Tip in cents. Never null.
total_amount Integer Total cost in cents to user after tax, tip, and discounts. This is equivalent to the “balance” field on in-store orders. Never null.
uuid String Unique identifier for order. This will also match the UUID for the order created in-store.

When the order is ready for the client, but has validation errors:

HTTP 422 Unprocessable Entity

[{
  "error": {
    ...
  }
}]