Order Webhooks

By using the ‘WebhookUrl’ field, you can specify a callback URL to get an update when the order status changes. If the ‘WebhookUrl’ is set, the API will send a HTTP POST request to that URL with a JSON payload containing the OrderId when the order status is changed. The status will be passed in a header called "Event-Type" where possible statuses are:
"order_created", "order_dispatched", "order_assigned", "order_picked_up", "driver_arrived_at_pickup", "driver_arrived_at_delivery", "order_delivered", "order_cancelled", "order_on_hold", "order_released", "driver_unassigned".

[OrderCreated]
Header: Event-Type: "order_created"
Body:
{
"OrderId": "CONTOSO123"
}

[OrderDispatchedToDriver]
Header: Event-Type: "order_dispatched"
Body:
{
"OrderId": "CONTOSO123",
"DriverId": "fe4bc3ab-ece3-4163-aced-13af016877fd"
"DriverNumber": "123"
"DriverName": "Ryan Gosling",
}

[OrderAcceptedByDriver]
Header: Event-Type: "order_assigned"
Body:
{
"OrderId": "CONTOSO123",
"DriverId": "fe4bc3ab-ece3-4163-aced-13af016877fd"
"DriverNumber": "123"
"DriverName": "Ryan Gosling",
}

[DriverArrivedAtPickup]
Header: Event-Type: "driver_arrived_at_pickup"
Body:
{
"OrderId": "CONTOSO123"
}

[OrderPickedUp]
Header: Event-Type: order_picked_up
Body:
{
"OrderId": "CONTOSO123"
}

[DriverUnassigned]
Header: Event-Type: driver_unassigned
Body:
{
"UnassignedDriverId": "fe4bc3ab-ece3-4163-aced-13af016877fd"
"UnassignedDriverNumber": "123"
"UnassignedDriverName ": "Ryan Gosling"
}

[DriverArrivedAtDelivery]
Header: Event-Type: "driver_arrived_at_delivery"
Body:
{
"OrderId": "CONTOSO123"
}

[OrderDelivered]
Header: Event-Type: "order_delivered"
Body:
{
"OrderId": "CONTOSO123",
"CustomerName": "Ron Pearlman"
}

[OrderReleased]
Header: Event-Type: "order_released"
Body:
{
"OrderId": "CONTOSO123"
}

[OrderPutOnHold]
Header: Event-Type: "order_on_hold"
Body:
{
"OrderId": "CONTOSO123",
"HoldReadon": "Nobodyhome",
"HoldReasonDescriptionEn": "No access to door",
"HoldReasonDescriptionFr": "Pas d'accès à la porte"
}

[OrderCancelled]
Header: Event-Type: "order_cancelled"
Body:
{
"OrderId": "CONTOSO123"
}