Order Ahead .: Show a Completed Order Ahead Order

API Reference / v15

Show a Completed Order Ahead Order

This endpoint returns details about an order ahead order after it has been submitted for completion. After completing an order, the client should poll this endpoint until it responds with HTTP 200 OK.

Request Endpoint

GET /v15/order_ahead/orders/:uuid/complete

Authorization

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

cURL Example

curl https://api.thelevelup.com/v15/order_ahead/orders/f7943600849501323c1552668b2aa48c/complete \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token user="1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"'

Example Response

When the order is still being processed

HTTP 202 Accepted

When the order has been successfully submitted to the merchant via their order ahead provider.

HTTP 200 OK

In both cases, we will return a response body that looks like:

{
  "order": {
    "conveyance": {
      "delivery_address_id": null,
      "fulfillment_type": "pickup",
      "desired_ready_time": "2016-02-16T15:00:00Z"
    },
    "discount_amount": 100,
    "instructions": "Pick up your food at the counter.",
    "items": [
      {
        "item": {
          "name": "Double Cheddar Frikandel",
          "quantity": 1,
          "selected_options_description": "Small fries, garlic sauce"
        }
      }
    ],
    "latitude": 42.3557498,
    "location_id": 1855,
    "location_subtitle": "Boston, MA 02110",
    "location_title": "1 Federal St",
    "longitude": -71.0565637,
    "order_number": "1000432",
    "phone": "617-867-5309",
    "ready_at": "2015-09-17T15:08:00Z",
    "total_amount": 945,
    "uuid": "f7943600849501323c1552668b2aa48c"
  }
}

Response Parameters

Name Type Description
conveyance[delivery_address_
id]
Integer, null For delivery orders, the ID of the user address to which this order will be delivered. For pickup orders,null.
conveyance[fulfillment_type] String Either “delivery” or “pickup”.
conveyance[desired_ready_
time]
String, null ISO 8601-formatted timestamp representing the time at which the user wants the order. Will benullif the user wants the order ASAP.
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[name] String The item’s name.
item[quantity] Integer The quantity ordered by the user.
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 benull.
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.
longitude Decimal The longitude of the merchant location.
order_number String The unique identifier for the order that should be displayed to the user. It’s meant to be easier for a customer to read over the phone to a support representative than the order’s UUID.
phone String The merchant location’s phone number.
ready_at String ISO 8601-formatted timestamp representing the time at which the order will be ready for pickup.
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.

Errors

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

HTTP 422 Unprocessable Entity

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