v1-webhook


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.

order-placed

Type: object

Fired when a new order is created on the Relay Platform.


Example:

{
    "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"
}

Type: const
Specific value: "order_placed"

Type: stringFormat: date-time

the time the order was placed. equal to time.placed

Type: string

Type: string

Type: boolean

Type: object

Type: string

Type: string

Type: object

Type: string or null

Type: stringFormat: zip-code

Type: object

Type: object

Type: object

Type: stringFormat: date-time

Type: stringFormat: date-time

the time the order is considered late

Type: boolean

if true then this order is not treated as an ASAP delivery.

Type: object

Type: number

Type: number

may not represent the final tip for phone orders

Type: number

Type: number

Type: number

the delivery fee paid by the consumer

Type: number

the flat fee amount that is paid to Relay

Type: number

the percentage fee amount that is paid to Relay

order-void

Type: object

Fired when an order is voided. Orders may be voided by the creator of the order, restaurant staff or by Relay admins.

Type: const
Specific value: "order_void"

Type: stringFormat: date-time

the time the order was voided

Type: string

Type: string

Type: object

Type: enum (of string)

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.

Must be one of:

  • "VOIDED_BY_SOURCE"
  • "RESTAURANT_CLOSED"
  • "DRIVER_UNABLE_TO_FINISH_DELIVERY"
  • "ORDER_PICKED_UP_BY_ANOTHER_DRIVER"
  • "RESTAURANT_CANNOT_FULFILL_ORDER"
  • "RESTAURANT_DID_NOT_RECEIVE_THE_ORDER"
  • "NO_DRIVER"
  • "VOIDED_BY_RELAY"

Type: string

A short description of the void operation

pickup-completed

Type: object

Fired when a rider completed a pickup from a producer location. Pickups can contain one or more orders.

Type: string

Type: object

Type: array of object
No Additional Items

Each item of this array must be:

Type: object

Type: object

Type: stringFormat: date-time

The estimated time that the rider will arrive at the consumer's location.

Type: stringFormat: date-time

the time the pickup was completed

Type: const
Specific value: "pickup_completed"

order-location

Type: object

Fired when orders are en-route to the consumer.

Type: string

Type: string

Type: string

Type: string

Type: object

See the https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates for more information

Type: object

Type: stringFormat: date-time

Type: const
Specific value: "order_location"

delivery-completed

Type: object

Fired when a delivery is successfully completed.

Type: const
Specific value: "delivery_completed"

Type: stringFormat: date-time

the time the delivery was completed

Type: string

Type: string

Type: object

delivery-failed

Type: object

Fire in the rare case that the consumer is not reachable and the delivery cannot be completed.

Type: string

Type: string

Type: object

Type: stringFormat: date-time

the time that the delivery was marked as failed

Type: const
Specific value: "delivery_failed"