This webhook will be called when one or more orders have been picked up by a driver. The request from the webhook would look like this:
{
"name": "pickupOrder",
"sent": "2018-04-13T08:40:28.297Z",
"data": [
{
"orderId": "5ad066886a9deecd679e6ac5",
"orderNumber": "WUX-123-45678901",
"requisition": "this-is-requisition",
"status": "inTransit",
"statusPartial": true,
"email": "[email protected]",
"tntKey": "dccd286c-8a17-4729-a499-6934d46930c1",
"vehicleId": "5e1ddf5052f3b0002f18af81",
"taskListId": "64998a85ce9d5d00c7d7cd7d",
"historyId": "64cefc58e5012800e57eec69",
"pickupTime": "2024-04-21T12:34:56.789Z"
"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 | inTransit is when the order was picked up successfully. onHold is when the order was not picked up successfully. |
statusPartial | This tell if only some of the cargo on the order have been picked up |
The email for the pickup | |
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 |
pickupTime | The time the pickup was registered to be done. That's in UTC time |
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 picked up successfully, like how many that was picked up damaged |
cargo.commentFailure | Gives a list of comments for how the cargo was not picked up successfully, like what was the reason for the cargo not to be picked up, for example it was missing |
If orderNumber, requisition or cargo is not set, it will not be in the payload.
historyId and pickupTime can be used to group multiple pickups for an order together. For example any delivery for on an order will each have their own historyId unique for that.