Important |
To use the |
You can use the orders API to modify the following delivery information:
Value |
Description |
---|---|
|
The date and time when the delivery employee indicated the order was delivered. |
|
The date and time when the delivery employee indicated the order was delivered. |
|
The status of the delivery order. The available values
for
|
|
Contains the Toast platform GUID of the employee assigned as the delivery driver. |
|
The delivery notes for the order. When you update the order's delivery notes, any existing notes are overwritten. |
Note |
The delivery location values (for example, street address and city) cannot be updated. |
To update delivery information, you send a
PATCH
request to the
/orders/
endpoint of the orders API. The request must include a JSON
{orderGuid}
/deliveryInfoDeliveryInfo
object that provides the updated values.
For more information about the endpoint used in this process, see the /deliveryInfo reference guide.
To update the delivery information for an existing order
-
Locate the Toast platform GUID for the order you are updating. For more information on locating an order GUID see Finding an order or check GUID.
-
If you plan to update an order's
deliveryEmployee
field, locate the Toast platform GUID of the employee to assign as the delivery driver. For information on retrieving employee details, see Getting all employees of a restaurant. -
Create a JSON
DeliveryInfo
object that contains the delivery information you want to update. For the list of values you can modify see Delivery values.The delivery location values (for example, street address and city) cannot be updated.
For an example
DeliveryInfo
object, see Example DeliveryInfo object. -
Send a
PATCH
request to the/orders/
endpoint of the orders API.{orderGuid}
/deliveryInfoIn the
PATCH
path, include the Toast platform GUID of the order.In the body of the request, include the
DeliveryInfo
object with the delivery information you want to update. -
Examine the response data you receive from the orders API. Verify your request is processed successfully with a 200 HTTP code response.
The response contains the full
Order
object. For an example, see this response.
Note |
Once an order's |
The following example shows the DeliveryInfo
object for
updating delivery information for an order. For definitions of the values
below, see Delivery values.
{ "deliveredDate": "2021-09-14T17:57:42.263+0000","dispatchedDate": "2021-09-14T17:57:42.263+0000",
"deliveryState": "DELIVERED",
"deliveryEmployee": { "guid": "e10f2ae0-9690-4ab2-86fe-fa6603d708d0"
}, "notes": "Leave order at door."
}
The date and time when the delivery employee indicated the order was delivered. |
|
The date and time the restaurant indicated the order was available for delivery and was assigned to a delivery employee. |
|
The state of a delivery order. The possible values are
|
|
The Toast platform GUID of the delivery employee at the restaurant. |
|
The delivery notes for the order. |
The following example shows the response for a PATCH
request to the
/orders/
endpoint of the orders API.
{orderGuid}
/deliveryInfo
{ "guid": "d16ceaeb-d8a3-4d47-82db-0199d37c0713","entityType": "Order", [contents omitted] "deliveryInfo": {
"address1": "401 Park Drive", "address2": "Suite 801", "city": "Boston", "state": "MA", "zipCode": "02215", "latitude": 42.3446671, "longitude": -71.1023575, "notes": "Leave order at door.", "deliveredDate": "2021-09-14T17:57:42.263+0000", "dispatchedDate": "2021-09-14T17:57:42.263+0000", "deliveryEmployee": { "guid": "e10f2ae0-9690-4ab2-86fe-fa6603d708d0", "entityType": "RestaurantUser", "externalId": null }, "deliveryState": "DELIVERED" }, [contents omitted] "diningOption": { "guid": "f6cd5b58-27d7-462a-922f-7f919a6f9137",
"entityType": "DiningOption", "externalId": null }, [contents omitted] }
The following image shows an order on the Unassigned tab of the Delivery screen on a Toast POS device.
The following image shows the order on the
Delivered tab after a PATCH
request
changed the order status to DELIVERED
and added a delivery
employee.