View customer orders that have already been placed. All of these requests require an access token in the Authorization HTTP header.

View a single order

Request

GET /customer/orders/recent/{order_id}

Parameters

Parameters Values Description
order_id String Unique id of the order.

Response

{
    "message": [],
    "order": {
        "order_id": 12107820,
        "merchant_id": 67193,
        "name": "Cafe Fresco",
        "street": "1239 1ST AVE",
        "city": "NEW YORK",
        "state": "NY",
        "zip_code": "10065",
        "phone": "212-535-9030",
        "confirmed": true,
        "instructions": "",
        "payment_method": "Deal",
        "order_date": "2014-02-01T11:16:12-0500",
        "delivery_date": "2014-02-01T11:16:12-0500",
        "location_id": 1481165,
        "latitude": 40.767302,
        "longitude": -73.956324,
        "discount": 0,
        "delivery_fee": 0,
        "tax": 1.97,
        "subtotal": 22.2,
        "tip": 3.33,
        "total": 27.5,
        "gift_card_amount_used": 0,
        "promo_amount_used": 8,
        "points_earned": 555,
        "type": "delivery",
        "cart": [
            {
                "id": "N2998",
                "item_key": 1,
                "name": "Two Eggs Sandwich",
                "price": 4.25,
                "quantity": 1,
                "options": [
                    {
                        "id": "N3252",
                        "item_key": 1,
                        "name": "Egg Preparation",
                        "quantity": 1,
                        "options": [
                            {
                                "id": "N3258",
                                "item_key": 1,
                                "name": "Fried Over Medium",
                                "quantity": 1
                            }
                        ]
                    },
                    {
                        "id": "N3253",
                        "item_key": 2,
                        "name": "Egg Sandwich Add Ons",
                        "quantity": 1,
                        "options": [
                            {
                                "id": "N3269",
                                "item_key": 1,
                                "name": "with Bacon",
                                "quantity": 1
                            }
                        ]
                    },
                    {
                        "id": "N3254",
                        "item_key": 3,
                        "name": "Sandwich Preparation",
                        "quantity": 1,
                        "options": [
                            {
                                "id": "N3273",
                                "item_key": 1,
                                "name": "Sesame Bagel",
                                "quantity": 1
                            }
                        ]
                    },
                    {
                        "id": "N3255",
                        "item_key": 4,
                        "name": "Breakfast Add Ons",
                        "quantity": 1
                    }
                ]
            }
        ],
        "favorite": false,
        "favorite_name": null,
        "vertical": {
            "type": "R",
            "name": "restaurant",
            "label": "Restaurant"
        }
    }
}
Property Name Type Description
order Object[] An object which contains the order details.
order.order_id Integer Unique id for this order.
order.merchant_id Integer Unique id of the merchant that this order was placed with.
order.name Integer Name of the merchant.
order.street String Street address of merchant.
order.city String City of merchant.
order.state String 2 character state of the merchant.
order.zip String 5 digit zip of the merchant.
order.phone String Phone number of merchant.
order.confirmed true|false Whether or not the order was confirmed by the merchant. If this is false, order was most likely cancelled.
order.instructions String Any special delivery/pickup instructions left by the user.
order.payment_method String Description of the payment method used on the order.
order_date String Time the order was placed in ISO 8601 format.
delivery_date String Requested delivery time of the order in ISO 8601 format. If this is the same as order_date, it was an ASAP order.
location_id Integer Unique id for the customer’s address.
latitude Double Latitude of the location that the order is delivered to.
longitude Double Longitude of the location that the order is delivered to.
discount Float Dollar amount of the order that was discounted by the merchant.
delivery_fee Float Dollar amount of the delivery_fee.
tax Float Dollar amount of the tax.
subtotal Float Dollar amount of the subtotal.
tip Float Dollar amount of the tip.
total Float Dollar amount of the total.
gift_card_amount_used Float Dollar amount that was paid with a gift card.
promo_amount_used Float Dollar amount that was paid with a delivery.com promotion.
points_earned Integer How many delivery points were earned for this order.
type pickup|delivery Type of the order.
favorite true|false If true, the user has saved this order as a favorite.
favorite_name String|null If the order has been favorited, this is the name the user gave to it, like ‘My cafe Fresco Sunday brunch.’
vertical Object Information about the type of merchant this is. See merchant-search for a list of possible verticals.
cart Object[] Array of ‘order entities’ (items, option_groups, options) that describe the contents of the order. The structure is similar to our menu entities. “
cart.id String ID of the entity.
cart.item_key Integer The item’s index within the array of entities.
cart.name String Name of the entity.
cart.price Float Only on the top level entities (items). Not on options. Total price of the item, including selected options.
cart.quantity Float What quantity of this entity.
cart.options Object[] Array of child entities. Structure is the same as the ‘top-level entity’ except there is no price listed.

View order history

Request

GET /customer/orders/recent

Parameters

There are no parameters for this request.

Response

{
    "message": [],
    "orders": [
        {
            "order_id": "12107820",
            "merchant_id": "67193",
            "name": "Cafe Fresco",
            "confirmed": true,
            "order_date": "2014-02-01T11:16:12-0500",
            "delivery_date": "2014-02-01T11:16:12-0500",
            "location_id": "1481165",
            "total": 27.5,
            "type": "delivery",
            "favorite": false,
            "favorite_name": null,
            "vertical": {
                "type": "R",
                "name": "restaurant",
                "label": "Restaurant"
            }
        },
        {
            "order_id": "12072307",
            "merchant_id": "71843",
            "name": "Salvo's Pizzabar",
            "confirmed": true,
            "order_date": "2014-01-26T18:43:30-0500",
            "delivery_date": "2014-01-26T18:43:30-0500",
            "location_id": "1481165",
            "total": 30.34,
            "type": "delivery",
            "favorite": false,
            "favorite_name": null,
            "vertical": {
                "type": "R",
                "name": "restaurant",
                "label": "Restaurant"
            }
        }
    ]
Property Name Type Description.
orders Object[] Array of order details.
order.order_id Integer Unique id for this order.
order.merchant_id Integer Unique id of the merchant that this order was placed with.
order.name Integer Name of the merchant.
order.confirmed true|false Whether or not the order was confirmed by the merchant. If this is false, order was most likely cancelled.
order_date String Time the order was placed in ISO 8601 format.
delivery_date String Requested delivery time of the order in ISO 8601 format. If this is the same as order_date, it was an ASAP order.
location_id Integer Unique id for the customer’s address.
total Float Dollar amount of the total.
type pickup|delivery Type of the order.
favorite true|false If true, the user has saved this order as a favorite.
favorite_name String|null If the order has been favorited, this is the name the user gave to it, like ‘My cafe Fresco Sunday brunch.’
vertical Object Information about the type of merchant this is. See merchant-search for a list of possible verticals.

Re-order

Request

POST /customer/cart/reorder

Parameters

Parameters Values Description
order_id String Unique id of the order.

Response

{
  "message": [
    
  ],
  "merchant_id": "752",
  "url": {
    "geo": null,
    "merchant": null,
    "geo_tag": "nyc",
    "short_tag": "underground-pizza"
  },
  "location": {
    "location_id": "1574911",
    "street": "199 WATER ST",
    "city": "NEW YORK",
    "state": "NY",
    "phone": "555-555-5555",
    "zip_code": "10038",
    "cross_streets": "Fulton Street",
    "unit_number": "",
    "company": "",
    "building_id": "2580",
    "latitude": "40.7068885740958600",
    "longitude": "-74.0042710304260300"
  }
}

Get Favorite Orders

Request

GET /api/customer/orders/favorite

Parameters

None

Response

{
  "message": [
    
  ],
  "orders": [
    {
      "merchant_id": "752",
      "merchant_name": "Underground Pizza",
      "merchant_url": "underground-pizza",
      "favorite_order_id": "521309",
      "orders_id": "11988895",
      "order_name": "",
      "order_total": 78.39,
      "order_date": "2014-04-04T13:18:44-0400",
      "delivery_date": "2014-04-04T13:18:44-0400",
      "integration_id": ""
    }
  ]
}

Add Favorite Order

Request

POST /api/customer/orders/favorite/{order_id}

Parameters

Parameters Values Description
order_name String Optional, a convenience name for the order

Response

{
    "message": [
        {
            "code": "favo_add_success",
            "user_msg": "Order successfully added to favorites.",
            "dev_msg": "Order successfully added to favorites."
        }
    ]
}

Remove Favorite Order

Request

DELETE /customer/orders/favorite/{order_id}

Parameters

None

Response

{
    "message": [
        {
            "code": "favo_remove_success",
            "user_msg": "Order successfully removed from favorites.",
            "dev_msg": "Order successfully removed from favorites."
        }
    ]
}