Deliveries
Through the Delivery component of the POS API provides a means to get delivery-specific information for Grubhub Delivery Orders. For example, you can track delivery status, driver assignment, and geolocation.
Polling and webhooks are both available as options to get event updates; however, subscribing to webhooks is preferred for high traffic clients.
Delivery objects include the following time information:
- Estimates of the pickup and delivery location arrival times.
- Pickup and delivery location departure times.
- Time when the driver entered within a geofence of the pickup and delivery locations.
With this information, you can:
- Provide customers with their expected delivery time.
- As a quick-service restaurants, assemble the customer's food when the driver is nearby.
- Use time records to update estimate values.
Paths
Get Delivery by Order ID
GET /pos/v1/merchant/{merchant_id}/orders/{order_uuid}/deliveryRetrieve the current state of a Delivery for an Order.
{
"delivery": {
"id": "xxx-xxxxxxxxxxxxxx",
"account_id": "xxxxxxxxxxxxxxxx",
"confirmation_code": "HVUYBJH",
"trip_id": "UvYO6VyVEeiVadmHZVMREg",
"name": "Grubhub order 76884765873",
"pickup": {
"name": "Good Food, Inc.",
"address": {
"street_address1": "123 Main Ave",
"city": "Anytown",
"state": "NY",
"postal_code": "11111",
"country": "USA"
},
"phone": "4045551212",
"notes": "",
"geo": {
"lat": 37.65947723,
"lng": -81.43487549
}
},
"dropoff": {
"name": "Steve McSteverson",
"address": {
"street_address1": "2940 Secondary Ln",
"street_address2": "",
"city": "Anytown",
"state": "NY",
"postal_code": "11111",
"country": "US"
},
"phone": "4045552121",
"notes": "",
"geo": {
"lat": 37.67552947,
"lng": -81.40675355
}
},
"contents": [{
"description": "Slider",
"quantity": 6
}, {
"description": "Chocolate Chip Cookie",
"quantity": 1
}, {
"description": "Chocolate Chip Cookie",
"quantity": 1
}],
"status": "DELIVERED",
"courier": {
"id": "X-xxxxxxxxxxxx",
"name": "Jack Burton",
"vehicle": {
"type": "car",
"description": ""
},
"phone": "4045552323",
"photo_url": "https://s3.amazonaws.com/gh-prod-drivers-data/drivers/xxxxx/avatar.png",
"geo": {
"lat": 37.67577137428678,
"lng": -81.40696178943328
}
},
"created": "2018-05-21T00:42:03.300Z",
"pickup_ready": "2018-05-21T00:32:09.492Z",
"pickup_feasibility_time": "2018-05-21T01:12:39.535Z",
"times": {
"pickup_arrival": {
"type": "actual",
"timestamp": "2018-05-21T02:05:51.993Z"
},
"pickup": {
"type": "actual",
"timestamp": "2018-05-21T02:10:58.458Z"
},
"dropoff_arrival": {
"type": "actual",
"timestamp": "2018-05-21T02:38:10.913Z"
},
"dropoff": {
"type": "actual",
"timestamp": "2018-05-21T02:38:12.020Z"
},
"geofence_pickup_arrival": {
"type": "actual",
"timestamp": "2018-05-21T02:05:52.100Z"
}
},
"committed_times": {
"pickup_arrival": {
"type": "estimate",
"timestamp": "2018-05-21T01:12:39.535Z"
},
"pickup": {
"type": "estimate",
"timestamp": "2018-05-21T01:15:39.535Z"
},
"dropoff_arrival": {
"type": "estimate",
"timestamp": "2018-05-21T01:26:46.535Z"
},
"dropoff": {
"type": "estimate",
"timestamp": "2018-05-21T01:28:46.535Z"
}
},
"cost": {
"amount": 696,
"currency": "USD"
},
"collected_tip": {
"amount": 200,
"currency": "USD"
},
"total": {
"amount": 1822,
"currency": "USD"
},
"preferences": {
"pickup_time": "2018-05-21T01:15:39.535Z",
"delivery_time": "2018-05-21T01:23:41.672Z"
},
"metadata": {
"grubhub_cust_id": "735541",
"grubhub_diner_uuid": "f3e00ff0-5c8a-11e8-ad7c-810ac177323e",
"grubhub_order_uuid": "bbd2cef4-5c89-11e8-9ff1-73136060c4b4",
"grubhub_order_number": "321404324050800",
"grubhub_requested_fulfillment_at": "2018-05-21T01:23:41.672Z",
"grubhub_brand": "GRUBHUB",
"grubhub_contact_email": "grubhub987654321@gmail.com",
"grubhub_future_check_v2": "true",
"grubhub_order_type": "ANTICIPATED",
"grubhub_confirmation_code": "LNQDMB",
"grubhub_has_alcohol": "false",
"grubhub_not_for_biker": "false",
"grubhub_needs_attention": "false",
"grubhub_quote.currency": "USD",
"grubhub_quote.amount": "398",
"grubhub_quote.id": "1e7d67c1-56b2-41f6-91a8-2d51f933de5f",
"grubhub_quote.reasons": "BASE_DELIVERY_RATE, BASE_DISTANCE_RATE",
"grubhub_quote.breakdown": "[{\"id\":\"uo57eAfgR3mF3fVaf9_UPQ\",\"cost\":{\"amount\":300,\"currency\":\"USD\"},\"reason\":\"BASE_DELIVERY_RATE\",\"type\":\"DELIVERY\"},{\"id\":\"uo57eAfgR3mF3fVaf9_UPQ\",\"cost\":{\"amount\":50,\"currency\":\"USD\"},\"reason\":\"BASE_DISTANCE_RATE\",\"type\":\"DISTANCE\"}]"
},
"catering_order": false,
"ticket_id": null,
"update_time": "AUFOYFygEeil4nOupoN1xg"
},
"time_stamp": "2018-05-21T02:38:42.326Z",
"delivery_status": "DELIVERED"
}
Get Delivery by Delivery ID
GET /pos/v1/deliveries/{delivery_id}Deprecated. Provided for backwards compatibility only. Retrieve the current state of a Delivery.
{
"delivery": {
"id": "xxx-xxxxxxxxxxxxxx",
"account_id": "xxxxxxxxxxxxxxxx",
"confirmation_code": "HVUYBJH",
"trip_id": "UvYO6VyVEeiVadmHZVMREg",
"name": "Grubhub order 76884765873",
"pickup": {
"name": "Good Food, Inc.",
"address": {
"street_address1": "123 Main Ave",
"city": "Anytown",
"state": "NY",
"postal_code": "11111",
"country": "USA"
},
"phone": "4045551212",
"notes": "",
"geo": {
"lat": 37.65947723,
"lng": -81.43487549
}
},
"dropoff": {
"name": "Steve McSteverson",
"address": {
"street_address1": "2940 Secondary Ln",
"street_address2": "",
"city": "Anytown",
"state": "NY",
"postal_code": "11111",
"country": "US"
},
"phone": "4045552121",
"notes": "",
"geo": {
"lat": 37.67552947,
"lng": -81.40675355
}
},
"contents": [{
"description": "Slider",
"quantity": 6
}, {
"description": "Chocolate Chip Cookie",
"quantity": 1
}, {
"description": "Chocolate Chip Cookie",
"quantity": 1
}],
"status": "DELIVERED",
"courier": {
"id": "X-xxxxxxxxxxxx",
"name": "Jack Burton",
"vehicle": {
"type": "car",
"description": ""
},
"phone": "4045552323",
"photo_url": "https://s3.amazonaws.com/gh-prod-drivers-data/drivers/xxxxx/avatar.png",
"geo": {
"lat": 37.67577137428678,
"lng": -81.40696178943328
}
},
"created": "2018-05-21T00:42:03.300Z",
"pickup_ready": "2018-05-21T00:32:09.492Z",
"pickup_feasibility_time": "2018-05-21T01:12:39.535Z",
"times": {
"pickup_arrival": {
"type": "actual",
"timestamp": "2018-05-21T02:05:51.993Z"
},
"pickup": {
"type": "actual",
"timestamp": "2018-05-21T02:10:58.458Z"
},
"dropoff_arrival": {
"type": "actual",
"timestamp": "2018-05-21T02:38:10.913Z"
},
"dropoff": {
"type": "actual",
"timestamp": "2018-05-21T02:38:12.020Z"
},
"geofence_pickup_arrival": {
"type": "actual",
"timestamp": "2018-05-21T02:05:52.100Z"
}
},
"committed_times": {
"pickup_arrival": {
"type": "estimate",
"timestamp": "2018-05-21T01:12:39.535Z"
},
"pickup": {
"type": "estimate",
"timestamp": "2018-05-21T01:15:39.535Z"
},
"dropoff_arrival": {
"type": "estimate",
"timestamp": "2018-05-21T01:26:46.535Z"
},
"dropoff": {
"type": "estimate",
"timestamp": "2018-05-21T01:28:46.535Z"
}
},
"cost": {
"amount": 696,
"currency": "USD"
},
"collected_tip": {
"amount": 200,
"currency": "USD"
},
"total": {
"amount": 1822,
"currency": "USD"
},
"preferences": {
"pickup_time": "2018-05-21T01:15:39.535Z",
"delivery_time": "2018-05-21T01:23:41.672Z"
},
"metadata": {
"grubhub_cust_id": "735541",
"grubhub_diner_uuid": "f3e00ff0-5c8a-11e8-ad7c-810ac177323e",
"grubhub_order_uuid": "bbd2cef4-5c89-11e8-9ff1-73136060c4b4",
"grubhub_order_number": "321404324050800",
"grubhub_requested_fulfillment_at": "2018-05-21T01:23:41.672Z",
"grubhub_brand": "GRUBHUB",
"grubhub_contact_email": "grubhub987654321@gmail.com",
"grubhub_future_check_v2": "true",
"grubhub_order_type": "ANTICIPATED",
"grubhub_confirmation_code": "LNQDMB",
"grubhub_has_alcohol": "false",
"grubhub_not_for_biker": "false",
"grubhub_needs_attention": "false",
"grubhub_quote.currency": "USD",
"grubhub_quote.amount": "398",
"grubhub_quote.id": "1e7d67c1-56b2-41f6-91a8-2d51f933de5f",
"grubhub_quote.reasons": "BASE_DELIVERY_RATE, BASE_DISTANCE_RATE",
"grubhub_quote.breakdown": "[{\"id\":\"uo57eAfgR3mF3fVaf9_UPQ\",\"cost\":{\"amount\":300,\"currency\":\"USD\"},\"reason\":\"BASE_DELIVERY_RATE\",\"type\":\"DELIVERY\"},{\"id\":\"uo57eAfgR3mF3fVaf9_UPQ\",\"cost\":{\"amount\":50,\"currency\":\"USD\"},\"reason\":\"BASE_DISTANCE_RATE\",\"type\":\"DISTANCE\"}]"
},
"catering_order": false,
"ticket_id": null,
"update_time": "AUFOYFygEeil4nOupoN1xg"
},
"time_stamp": "2018-05-21T02:38:42.326Z",
"delivery_status": "DELIVERED"
}
Models
Address
A physical address.
Courier
A courier (driver, biker, etc.) that has been assigned to fulfill a delivery.
Delivery
A delivery that has been created as the result of a delivery request.
Delivery Flag
Specifies an attribute of the delivery, which may affect dispatch handling.
string
- ALCOHOL
- LARGE_ORDER
Delivery Item
An item within the contents of a delivery.
Delivery Item Size
Size of an item.
string
- XS
- S
- M
- L
- XL
- XXL
Delivery Preferences
A set of preferred details about a delivery.
Delivery Status
Status of the delivery. Most of these statuses will only return for Grubhub-managed deliveries. This will return one of the following strings:
- ANTICIPATED - This order has been set to be fulfilled at a future time, so it has not begun preparation.
- ESTIMATED - This order has not yet been checked out by the diner, so it has not even been paid for. The numbers given are an estimate provided so that the diner can make a decision with complete information.
- COMMITTED - The restaurant has accepted the order and is starting to prepare the food.
- ASSIGNED - A trip offer has been sent to prospective couriers. Once a courier accepts the offer, they will arrive at the restaurant close to the promised fulfillment time to pick up the food.
- PICKUP_READY - The restaurant has completed preparing the food, so the driver should be there soon to pick it up and deliver it to the diner.
- IN_TRANSIT - The driver has picked up the food and is on their way to deliver it to the diner.
- DELIVERED - The driver has handed the food off to the diner and thus completed the delivery.
- CANCELED - The delivery order has been canceled and will not be taken to the diner. This delivery can be considered finished.
string
- ESTIMATED
- COMMITTED
- ASSIGNED
- IN_TRANSIT
- DELIVERED
- CANCELED
- PICKUP_READY
- REJECTED
- ANTICIPATED
Delivery Time
Estimated or actual time that a delivery event will or has taken place.
Delivery Time Type
Whether a time is estimated or actual.
string
- estimate
- actual
Delivery Times
Estimated or actual times for pickup and drop off of a delivery.
Geo Location
Latitude and longitude for a location.
Location
Geographic and contact details for where delivery contents will be picked up or dropped off.
Vehicle
A vehicle used by a courier.