Overview
OneRail provides immediate alerts regarding the change in status of orders and deliveries processed by your organization using webhooks. This can be processed by your application to push out notifications to customers/internal staff or dynamically respond and process depending on the status of the delivery.
Important Requirement: A webhook endpoint (URL) must be provided and configured BEFORE events will be sent to the shipper.
Without this configuration, event notifications will not be delivered.
The following list outlines expected results for standard courier events currently supported by OneRail as an example of the capabilities for events and webhooks from our API. Each event here is defined by its associated event type, their results include the OneRail delivery ID and subsequent shipper order ID associated with the event.
Delivery Event Descriptions
| Event Type | Description |
|---|---|
ACCEPTED_BY_LP
|
The logistics provider (LP) has accepted the delivery request. This confirms that a carrier has taken ownership of the delivery and it is queued for driver assignment. |
CANCELED_BY_ONERAIL
|
The delivery was canceled by OneRail. |
CANCELED_BY_SHIPPER
|
The delivery was canceled by the shipper. |
DRIVER_ASSIGNED
|
A driver has been assigned to the delivery. The event payload includes the driver's name, phone number, and the originating store number. |
EN_ROUTE_TO_PICKUP
|
The assigned driver is traveling to the pickup location. |
ARRIVED_FOR_PICKUP
|
The driver has arrived at the pickup location and is ready to collect the order. No items have been picked up at this stage. |
PICKED_UP
|
The driver has collected the order from the pickup location. |
EN_ROUTE_TO_DELIVERY
|
The driver is traveling to the customer's delivery address with the order on board. |
ARRIVED_FOR_DELIVERY
|
The driver has arrived at the customer's delivery address and is preparing to complete the handoff. |
DELIVERED
|
The order has been successfully delivered to the customer. |
NO_MATCHING_SLA_SHIPPER_CONTRACTS
|
Order created did not include a valid service level and the delivery needs to be addressed before a successful dispatch can occur. |
Note: Custom delivery events and webhooks are available if needed for your organization's implementation.
Event Payload Examples
ACCEPTED_BY_LP
{
"deliveryId": "onerail-internal-id",
"eventType": "ACCEPTED_BY_LP",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:09:20.003Z",
"routeId": "onerail-internal-id",
"vin": "vehicleVin",
"createDeliveryAttemptData": {
"lpName": "OneRail"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
} CANCELED_BY_ONERAIL
{
"deliveryId": "onerail-internal-id",
"eventType": "CANCELED_BY_ONERAIL",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:09:20.003Z",
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
} CANCELED_BY_SHIPPER
{
"deliveryId": "onerail-internal-id",
"eventType": "CANCELED_BY_SHIPPER",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:09:20.003Z",
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
} DRIVER_ASSIGNED
{
"deliveryId": "onerail-internal-id",
"eventType": "DRIVER_ASSIGNED",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:09:20.003Z",
"driverName": "DriverName",
"driverPhone": "DriverPhone",
"vin": "vehicleVin",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
} EN_ROUTE_TO_PICKUP
{
"deliveryId": "onerail-internal-id",
"eventType": "EN_ROUTE_TO_PICKUP",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:19:49.372Z",
"vin": "vehicleVin",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
}ARRIVED_FOR_PICKUP
{
"deliveryId": "onerail-internal-id",
"eventType": "ARRIVED_FOR_PICKUP",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:19:49.372Z",
"vin": "vehicleVin",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
}PICKED_UP
{
"deliveryId": "onerail-internal-id",
"eventType": "PICKED_UP",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:19:49.372Z",
"vin": "vehicleVin",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
}EN_ROUTE_TO_DELIVERY
{
"deliveryId": "onerail-internal-id",
"eventType": "EN_ROUTE_TO_DELIVERY",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:19:49.372Z",
"vin": "vehicleVin",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
}ARRIVED_FOR_DELIVERY
{
"deliveryId": "onerail-internal-id",
"eventType": "ARRIVED_FOR_DELIVERY",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:19:49.372Z",
"vin": "vehicleVin",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
}DELIVERED
{
"deliveryId": "onerail-internal-id",
"eventType": "DELIVERED",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:19:49.372Z",
"podUrl": "linkToImage",
"signature": "linkToImage",
"vin": "vehicleVin",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
}NO_MATCHING_SLA_SHIPPER_CONTRACTS
{
"deliveryId": "onerail-internal-id",
"eventType": "NO_MATCHING_SLA_SHIPPER_CONTRACTS",
"orderId": "client-unique-id",
"eventOn": "2021-10-12T17:09:20.003Z",
"from": {
"storeNumber": "ClientStoreNumber"
},
"shipper": {
"contractedShipperCostCent": 1104,
"computedDistanceMile": 3.47284
}
}
Comments
0 comments
Please sign in to leave a comment.