The Order Done callback occurs when an order is completed. This callback returns detailed information describing the order, including the order status.
<ROADCalloutwebhookRegistration />
Webhook
Below are the default parameters included in the task_done
webhook.
{
"task": {
"additional_attributes": {
"planned_distance_from_prev_task": 4.594
},
"id": 1236,
"status": 6,
"title": "Delivery Task",
"ended_time": "2023-01-01T12:52:00.000Z",
"external_id": "h9371",
"way_points": [
{
"id": 9878,
"position": 1,
"scheduled_at": null,
"eta": null,
"address": "123 Main St. New York, NY 10001",
},
{
"id": 9879,
"position": 2,
"scheduled_at": "2023-01-01T12:47:00.000Z",
"eta": "2023-01-01T12:47:00.000Z",
"address": "123 1st Ave. New York, NY 10002",
"checkout_time": "2023-01-01T12:52:00.000Z"
}
]
},
"webhook_type": "task_done",
"merchant_id": 1,
}
{
"task": {
"id": 10739113,
"status": 4,
"title": "Order with canceled inventory",
"external_id": "60",
"customer": {
"kind": 2,
"name": "John Doe Enterprises",
"external_id": "2000"
},
"user": {
"id": 4079,
"name": "Delivery Specialist"
},
"teams": [
{
"id": 2841,
"name": "Regional Team"
}
],
"way_points": [
{
"id": 17416992,
"position": 1,
"scheduled_at": "2024-05-06T06:00:00.000Z",
"eta": null,
"address": "123 Anywhere St, Metro City, Country",
"task_inventories": [
{
"id": 325813885,
"quantity": 5,
"scanned": false,
"original_quantity": 5,
"rejected_quantity": 0,
"external_id": "1113",
"name": "IcyFridge 58'",
"inventory_change_details": []
}
]
},
{
"id": 17416993,
"position": 2,
"scheduled_at": "2024-05-06T06:00:00.000Z",
"eta": "2024-05-06T07:10:00.000Z",
"address": "456 Main Rd, Metro City, Country",
"task_inventories": [
{
"id": 325813884,
"quantity": 1,
"scanned": false,
"original_quantity": 5,
"rejected_quantity": 4,
"external_id": "1113",
"name": "IcyFridge 58'",
"inventory_change_details": [
{
"change_type": 2,
"before": "0",
"after": "4",
"inventory_change": {
"reason_to_change_inventory_id": 421,
"reason_to_change_inventory": {
"reason": "Item is damaged"
}
}
}
]
}
]
}
]
},
"webhook_type": "task_done",
"merchant_id": 60364
}
Output Params
By default, the task_done
webhook includes a number of parameters from the Order (Task) Object, including an array of waypoints. You can also choose to include additional parameters when subscribing to webhooks.
Order Object
Waypoint Object
<ROADObjectWaypointResponse />