This guide will be removed on April 29, 2022. Please use our new, easier-to-use Toast technical documentation site. All updated content is on the new site.

How to update the delivery information

To update delivery information, you send a PATCH request to the /orders/{orderGuid}/deliveryInfo endpoint of the orders API. The request must include a JSON DeliveryInfo object that provides the updated values.

To update the delivery information for an existing order

  1. Find the Toast platform GUID for the order that you are updating the delivery information for. The order dining option must have behavior set to DELIVERY. For information about order dining options, see Order details based on the order dining option.

    • If your integration submits orders to Toast, then the response from the POST request to create an order contains the order GUID.

    • You can send a GET request to get the details for orders that were updated during a specific time interval. See Getting detailed information about multiple orders. The order details include the order GUID.

  2. If you plan to update the deliveryEmployee, find the Toast platform GUID of the employee to assign as the delivery driver.

    Note that to be able to update the delivery employee on an order, you must obtain additional permission from Toast. To retrieve employee GUIDs, you must have the labor.employees:read scope.

    For information on retrieving employee details, see Getting All Employees of a Restaurant.

  3. Create a JSON DeliveryInfo object that contains the delivery information that you want to update.

    You can update any of the following values. You only need to provide the values that you are updating.

    dispatchedDate

    The date and time when the restaurant indicated that the order was available for delivery and assigned to the delivery employee.

    For more information on formatting dates and times, see Dates and timestamps.

    deliveredDate

    The date and time when the delivery employee indicated that the order was delivered.

    For more information on formatting dates and times, see Dates and timestamps.

    deliveryState

    The state of the order delivery. The available values for deliveryState are:

    • PENDING - The delivery order is not dispatched. Corresponds to the Unassigned tab for deliveries on the Toast POS application.

    • PICKED_UP - The delivery employee has picked up the order from the restaurant.

    • IN_PROGRESS - The order is on its way to the destination. Corresponds to the En Route tab for deliveries on the Toast POS application.

    • DELIVERED - The order was delivered. Corresponds to the Delivered tab for deliveries on the Toast POS application.

    In a normal flow, deliveryState goes from PENDING to PICKED_UP to IN_PROGRESS to DELIVERED. However, you might change the deliveryState to a previous value in order to correct an error. For example, the delivery employee marks the wrong order as DELIVERED and needs to revert it to IN_PROGRESS.

    deliveryEmployee

    Contains the Toast platform GUID of the employee that is assigned as the delivery driver.

    To be able to update deliveryEmployee, you must obtain additional permission from Toast.

    You cannot update the delivery address fields or the delivery notes.

    For an example, see Example DeliveryInfo object.

  4. Send a PATCH request to the /orders/{orderGuid}/deliveryInfo endpoint of the orders API.

    In the PATCH request path parameters, include the Toast platform GUID of the order.

    In the body of the request, include the DeliveryInfo object with the delivery information that you want to update.

  5. Examine the response data that you receive from the orders API. Verify that your request is processed successfully with a 200 HTTP code response.

    The response contains the full Order object. For an example, see Example response when updating delivery information.