Relay sends all webhooks to a single url and the type of the webhook can be indentified by event property. See the different types of events available below.
Fired when a new order is created on the Relay Platform.
{
"orderKey": "30d85976-b8aa-4764-b959-f3d1344b9b90",
"externalId": "7HQNWE-BAQWE",
"consumer": {
"name": "Hungry Jerry",
"phone": "2126847270",
"location": {
"address1": "342 East 8th Street",
"city": "New York",
"state": "NY",
"zip": "10009",
"coordinates": {
"longitude": -73.9789024,
"latitude": 40.7247368
}
}
},
"isPickup": false,
"producer": {
"producerKey": "restaurantgroup",
"producerLocationKey": "restaurantlocation"
},
"time": {
"lateDelivery": "2022-04-15T20:25:46.898Z",
"isFutureOrder": false,
"placed": "2022-04-15T18:45:51.251Z",
"processed": "2022-04-15T18:45:51.251Z"
},
"price": {
"subTotal": 24.25,
"tip": 4,
"tax": 0,
"deliveryFee": 0,
"discount": 0,
"collect": 0,
"flatFee": 5.38,
"percentageFee": 0
},
"source": {
"label": "Mike's Menus",
"orderSourceKey": "mikesmenus"
},
"event": "order_placed",
"timestamp": "2022-04-15T18:45:51.251Z"
}
"order_placed"
the time the order was placed. equal to time.placed
the time the order is considered late
if true then this order is not treated as an ASAP delivery.
may not represent the final tip for phone orders
the delivery fee paid by the consumer
the flat fee amount that is paid to Relay
the percentage fee amount that is paid to Relay
Fired when an order is voided. Orders may be voided by the creator of the order, restaurant staff or by Relay admins.
"order_void"
the time the order was voided
The reason the order was voided:
VOIDED_BY_SOURCE
- Order was voided by request to the order/void endpoint.RESTAURANT_CLOSED
- The restaurant was closed.DRIVER_UNABLE_TO_FINISH_DELIVERY
- The rider has picked up the order but cannot complete delivery due to a mechanical issue, closed roads, etc.ORDER_PICKED_UP_BY_ANOTHER_DRIVER
- Order was mistakenly picked up by a different rider.RESTAURANT_CANNOT_FULFILL_ORDER
- The rider reports that the restaurant is unable to fulfill the order (e.g. due to requested items being unavailable).RESTAURANT_DID_NOT_RECEIVE_THE_ORDER
- Rider reports that the restauarant claims to never have received the order.VOIDED_BY_RELAY
- The order was voided by Relay for some other reason.A short description of the void operation
Fired when a rider is in range(~50 meters) of a restaurant (or more generically a producer or pickup).
{
"timestamp": "2022-09-22T16:20:09.004Z",
"event": "rider_at_producer",
"orderKey": "6287706d-5552-4373-a7ae-7f66136f365e",
"externalId": "WENWJJQ-A6P3AN",
"riderKey": "1a3b8e11d92bf926525fffe457c8a45e471be086",
"jobKey": "wasdf",
"coordinates": {
"latitude": 40.8508109,
"longitude": -73.9288919
},
"producer": {
"producerKey": "relay",
"producerLocationKey": "10b04c3f-e4fa-4c3b-b5f6-acac044444c3"
}
}
"rider_at_producer"
the time the rider crossed the restaurant's geofence.
The position of the rider
Riders are sometimes reassigned to a different order after they have accepted a job. This object contains the original job information regardless of any reassignments. This may be useful to you if you are interested in some advanced reporting use cases.
The actual time the rider accepted the job regardless of any order reassignment.
The time the rider arrived at the restaurant regardless of any order reassignment.
Fired when a pickup cannot be completed at the current time due to a delay at the restaurant/pickup location. The Relay operations team has determined that the order can be picked up, but not at this time. This is NOT a terminal event and Relay will attempt the pickup again after a short delay.
"order_pickup_paused"
the time the pickup was paused
A description of why relay is pausing the pickup. Written by relay support staff.
Fired when an order has been picked up by a rider.
"order_picked_up"
the time the delivery was completed
stops on the route to the consumer
No Additional Itemsthe index of the stop in the order (starts at 0)
Fired when a rider is in range(~50 meters) of a consumer's address. The rider hasn't clicked that they have arrived at the consumer yet, but are in range to do so successfully.
{
"timestamp": "2022-09-22T16:20:09.004Z",
"event": "rider_at_consumer",
"orderKey": "2e2af4fe-66d7-4668-9f39-f61241ae7306",
"externalId": "OMNAJJQ-R6X31N",
"riderKey": "1a2b8e11d92bf926525fff1457c8a45e471be086",
"coordinates": {
"latitude": 40.6041305,
"longitude": -73.9670488
},
"producer": {
"producerKey": "relay",
"producerLocationKey": "50d04c3f-e4fa-4c3b-b576-ac5c022ac4c3"
}
}
"rider_at_consumer"
the time the rider crossed the restaurant's geofence.
The position of the rider
Fired when a rider in on the way to deliver the order.
{
"timestamp": "2022-09-22T16:20:09.004Z",
"event": "order_en_route_for_delivery",
"orderKey": "2e2af4fe-66d7-4668-9f39-f61241ae7306",
"externalId": "OMNAJJQ-R6X31N",
"riderKey": "1a2b8e11d92bf926525fff1457c8a45e471be086",
"jobKey": "job_xb8e4Ta11Wd",
"coordinates": {
"latitude": 40.6041305,
"longitude": -73.9670488
},
"producer": {
"producerKey": "relay",
"producerLocationKey": "50d04c3f-e4fa-4c3b-b576-ac5c022ac4c3"
}
}
"order_en_route_for_delivery"
the time the rider started the delivery.
The position of the rider
Fired when a delivery is successfully completed.
"order_delivered"
the time the delivery was completed
URL to consumer signature POD if collected.
URL to consumer photo POD if collected.
URL to JSON output of barcode ID scan if required and completed successfully
URL to photo of consumer ID if barcode scan failed and manual review of consumer ID was needed
Fired in the rare case that the consumer is not reachable and the delivery cannot be completed.
"order_delivery_failed"
the time that the delivery was marked as failed
Fired when a delivery is successfully returned.
"order_delivery_returned"
the time the delivery was returned
This event fires when a rider has accepted a job. Under rare conditions Relay might fire this event multiple times as we reassign riders to an order.
"rider_accepted"
the time the rider accepted the job.
The name of the rider. Suitiable for display purposes.
URL to the rider's photo if available
the phone numbers for the consumer and producer to contact the rider (texts and calls supported).
the phone number is associated with the consumer's phone provided when creating the order
the phone number is associated with the producer's phone provided when creating the order.
Fired when the rider location has changed.
"rider_location"
See the https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates for more information
This event may fire before an order is picked up if a rider cancels the job. If the rider does cancel Relay will attempt to find a new rider for the job immediately. A rider is not able to cancel once the order has been picked up.
"rider_cancelled"
the time the rider cancelled the job.
Fired when some fields unrelated to delivery status are updated. For example, a phone number or specialInstructions edit.
"order_details_edited"
The time the order was edited.
A list of changes made to the original order.
No Additional ItemsThe path of the field that was changed. For example, "consumer.name" or "consumer.location.coordinates.latitude".
Fired when the rider location has changed. Includes GeoJSON attributes to render delivery path and rider's progress on path.
"order_delivery_path"
GeoJSON Feature containing a Point. See the https://www.rfc-editor.org/rfc/rfc7946.html#section-3.1.2 for more information.
Pickup location geocoded coordinates.
GeoJSON Feature containing a Point. See the https://www.rfc-editor.org/rfc/rfc7946.html#section-3.1.2 for more information.
Dropoff location geocoded coordinates.
GeoJSON FeatureCollection Points. See the https://www.rfc-editor.org/rfc/rfc7946.html#page-12 for more information.
Points represents the rider's progress on the delivery path.
GeoJSON Feature containing a LineString. See the https://www.rfc-editor.org/rfc/rfc7946.html#page-8 for more information.
The lineString is the delivery path between the pickup location and dropoff location.