Order Ahead .: Show a Proposed Order Ahead Order

API Reference / v15

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 until it responds with HTTP 200 OK.

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="1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"'

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,
    "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": 48,
    "soonest_available_at": "2016-03-25T15:08:00Z",
    "special_instructions_character_limit": 100,
    "spend_amount": 1000,
    "state": "externally_valid",
    "tax_amount": 45,
    "tip_amount": 0,
    "total_amount": 945,
    "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.
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 Mothership orders. Never null.
uuid String Unique identifier for order. This will also match the UUID for the order created on Mothership.

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

HTTP 422 Unprocessable Entity

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