Webhooks allow applications to communicate with each other in real-time, eliminating the need for manual intervention or polling for updates. Information between applications can be shared and processed much faster when requests are sent by the resource that contains the information only when a change is processed as opposed to a requester relying on an arbitrary polling interval.
OneRail provides immediate alerts regarding the change in status of orders processed by your organization. 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.
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.
Note: Custom delivery events and webhooks are available if needed for your organization's implementation.
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 } }
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", "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 } }
Comments
0 comments
Please sign in to leave a comment.