WebhooksOrdersETA & Delays
Orders At Risk
Webhook payload sent when the risk state of an order changes.
Order at risk Webhook Payload
[
{
"created_at":"2021-01-01T14:01:00.000000Z",
"recorded_at":"2021-01-01T14:00:00.000000Z",
"device_id":"00112233-4455-6677-8899-AABBCCDDEEFF",
"worker_handle": "Worker-1",
"account_id":"6784e919-7168-4f61-b686-2020f547637f",
"type":"order",
"data":{
"value":"risk_updated",
"order_handle":"DGC127092",
"route_handle":"4359cc65-90dd-4b2b-875b-26e6d2eba11d",
"status":"ongoing",
"share_url":"https://trck.at/vr1RNLq",
"risks":{
"deviating_from_expected_route":{
"intensity_label": "red",
"intensity_value": 0.85,
"previous_intensity_label": "yellow"
},
"moving_too_slow":{
"intensity_label": "yellow",
"intensity_value": 0.45,
"previous_intensity_label": "green"
}
},
"metadata":{
"storeId":"123490809808",
"customerName":"Andrew"
}
},
"version":"3.0.0"
}
]Following are the Risk elements:
delayed_from_scheduled_at: risk element that an order is delayed from the scheduled time of delivery.delayed_from_initial_eta: risk element that an order is delayed beyond the initial ETA communicated to the customeris_offline: risk element that an order is at risk because the device is not sending updates.deviating_from_expected_route: risk element that an order will be at risk because the worker is deviating from the expected route.moving_away_from_destination: risk element that an order will be at risk because the worker is moving away from the destination.in_low_battery: risk element that an order is at risk because the device may shut off before order completion.moving_too_slow: risk element that an order will be at risk because the worker is moving too slowly to fulfil the order.in_outage: risk element that an order is at risk because of a user-driven or software-driven action. eg: turn off GPS, background process killed etc.
| Name | Type | Mandatory | Description |
|---|---|---|---|
| data.value | string | Yes | risk_updated |
| data.order_handle | string | Yes | Unique handle for the Order |
| data.route_handle | string | Yes | Unique identifier of the route containing the order |
| data.status | string | Yes | Status of the order - ongoing |
| data.share_url | string | Yes | Contains tracking url of the order to provide real time visibility of worker on route of this order |
| data.metadata | object | No | Metadata that you have assigned to this order |
| data.risks | object | Yes | Order at risk state |
| data.risks.is_offline | object | No | Risk element evaluating the online/offline status of worker with a value of red or yellow |
| data.risks.deviating_from_expected_route | object | No | Risk element evaluating the deviation in route taken by worker against the expected route with a value of red or yellow |
| data.risks.moving_away_from_destination | object | No | Risk element evaluating the direction of worker, if he is moving away from destination with a value of red or yellow |
| data.risks.in_low_battery | object | No | Risk element evaluating the battery status of the worker's device with a value of red or yellow |
| data.risks.moving_too_slow | object | No | Risk element evaluating the speed of worker with a value of red or yellow |
| data.risks.in_outage | object | No | Risk element evaluating the outage status of worker with a value of red or yellow |
| data.risks..intensity_label | string | Yes | Risk elements intensity, can be red, yellow or green. green means no risk and red means at risk. |
| data.risks..intensity_value | number | Yes | Number between 0 and 1 representing the severity of risk where 0 is no risk. |
| data.risks..previous_intensity_label | string | No | Risk elements previously calculated intensity, useful in understanding which elements changed in this webhook |