Show Completed Order

Order Ahead / Endpoints

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 (at most once per second) until it no longer responds with HTTP 202 Accepted.

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="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"'

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"
    },
    "delivery_fee_amount": 100,
    "delivery_instructions": null,
    "delivery_uuid": null,
    "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,
                "free_quantity": 0,
                "name": "Flour Tortilla",
                "price_amount": 0,
                "quantity": 1
              }
            },
            {
              "option": {
                "id": 527,
                "free_quantity": 0,
                "name": "Green Salsa",
                "price_amount": 75,
                "quantity": 2
              }
            }
          ],
          "selected_options_description": "Flour Tortilla, Green Salsa (Quantity: 2)",
          "special_instructions": "Double wrap please.",
          "upsell_id": 52
        }
      }
    ],
    "latitude": 42.3557498,
    "location_id": 1855,
    "location_subtitle": "Boston, MA 02110",
    "location_title": "1 Federal St",
    "longitude": -71.0565637,
    "merchant_name": "LevelUp Cafe",
    "order_number": "1000432",
    "phone": "617-867-5309",
    "provider_service_fee_amount": 20,
    "ready_at": "2015-09-17T15:08:00Z",
    "service_fee_amount": 45,
    "spend_amount": 1195,
    "subtotal": 1150,
    "tax_amount": 45,
    "tip_amount": 0,
    "total_amount": 1240,
    "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 be null if the user wants the order ASAP.
delivery_fee_amount Integer The delivery fee charged to the user in cents. Never null.
delivery_instructions String, null For delivery orders, the delivery instructions from the user.
delivery_uuid String, null For delivery orders, the unique identifier for the delivery.
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.
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.
item[upsell_id] Integer The ID of the upsell that prompted the user to add this item to their cart.
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.
merchant_name String The merchant’s name.
option[id] 64 bit Integer The option’s ID. Note that this can exceed 32 bit integer values.
option[free_quantity] Integer The quantity of free selections that have been chosen.
option[name] String The option’s name.
option[price_amount] Integer The option’s price in cents, independent of the base price of any associated item. May be zero.
option[quantity] Integer The option’s quantity.
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.
provider_service_fee_amount Integer The service fee charged to the user by the third-party order ahead provider in cents. Never null.
ready_at String ISO 8601-formatted timestamp representing the time at which the order will be ready for pickup.
service_fee_amount Integer The combined amount of all service fees charged to the user in cents. Never null.
spend_amount Integer Total amount minus tax and tip. Never null.
subtotal Integer Subtotal of order in cents. 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.

Errors

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

HTTP 422 Unprocessable Entity

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