This webhook will be called when one or more orders have been delivered by a driver. The request from the webhook would look like this:
{
"name": "deliverOrder",
"sent": "2018-04-13T09:53:50.178Z",
"data": [
{
"orderId": "5ad066886a9deecd679e6ac5",
"orderNumber": "WUX-123-45678901",
"requisition": "this-is-requisition",
"status": "done",
"statusPartial": true,
"email": "[email protected]",
"tntKey": "dccd286c-8a17-4729-a499-6934d46930c1",
"vehicleId": "5e1ddf5052f3b0002f18af81",
"taskListId": "64998a85ce9d5d00c7d7cd7d",
"cargo": [
{
"cargoId": "63f3904237b66600314cc5fe",
"barcode": "BARCODE",
"scanned": true,
"amountSuccess": 1,
"amountFailure": 1,
"commentSuccess": {
"damaged": 1
},
"commentFailure": {
"missing": 1
}
}
]
}
]
}
The data contains:
Key | Description |
---|---|
orderId | The id of the order. |
orderNumber | The order number the order have been given. |
requisition | The requisition the order have been given. |
status | done is when the order was delivered successfully. returning is when the order was not delivered successfully. |
statusPartial | This tell if only some of the cargo on the order have been delivered |
The email for the delivery | |
tntKey | The key to be used for the Track & Trace link |
vehicleId | The id of the vehicle that handle the order |
taskListId | The id of the task list the order is on |
historyId | The id of the history that have been created based on this |
cargo | Is an array of all the information on how the cargo got registered |
cargo.cargoId | The unique id for the cargo |
cargo.barcode | The barcode that's on the cargo |
cargo.scanned | Tells if the cargo was scanned by the barcode |
cargo.amountSuccess | Tells how many of the cargo that was registered successfully |
cargo.amountFailure | Tells how many of the cargo that was not registered successfully |
cargo.commentSuccess | Gives a list of comments for how the cargo was delivered successfully, like how many that was delivered damaged |
cargo.commentFailure | Gives a list of comments for how the cargo was not delivered successfully, like what was the reason for the cargo not to be delivered, for example no where to place the cargo |
If orderNumber, requisition or cargo is not set, it will not be in the payload.