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 completed a pickup from a producer location. Pickups can contain one or more orders.
The estimated time that the rider will arrive at the consumer's location.
the time the pickup was completed
"pickup_completed"
Fired when orders are en-route to the consumer.
See the https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates for more information
"order_location"
Fired when a delivery is successfully completed.
"delivery_completed"
the time the delivery was completed
Fire in the rare case that the consumer is not reachable and the delivery cannot be completed.
the time that the delivery was marked as failed
"delivery_failed"