order-webhook-v2


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

rider-at-producer

Type: object

Fired when a rider is in range(~50 meters) of a restaurant (or more generically a producer or pickup).


Example:

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

Type: const
Specific value: "rider_at_producer"

Type: stringFormat: date-time

the time the rider crossed the restaurant's geofence.

Type: string

Type: string

Type: string

Type: object

The position of the rider

Type: object

Type: object

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.

Type: stringFormat: date-time

The actual time the rider accepted the job regardless of any order reassignment.

Type: stringFormat: date-time

The time the rider arrived at the restaurant regardless of any order reassignment.

order-pickup-paused

Type: object

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.

Type: const
Specific value: "order_pickup_paused"

Type: stringFormat: date-time

the time the pickup was paused

Type: object

Type: string

A description of why relay is pausing the pickup. Written by relay support staff.

order-picked-up

Type: object

Fired when an order has been picked up by a rider.

Type: const
Specific value: "order_picked_up"

Type: stringFormat: date-time

the time the delivery was completed

Type: string

Type: string

Type: array of object

stops on the route to the consumer

No Additional Items

Each item of this array must be:

Type: object

Type: number

the index of the stop in the order (starts at 0)

rider-at-consumer

Type: object

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.


Example:

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

Type: const
Specific value: "rider_at_consumer"

Type: stringFormat: date-time

the time the rider crossed the restaurant's geofence.

Type: string

Type: string

Type: object

The position of the rider

Type: object

order-en-route-for-delivery

Type: object

Fired when a rider in on the way to deliver the order.


Example:

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

Type: const
Specific value: "order_en_route_for_delivery"

Type: stringFormat: date-time

the time the rider started the delivery.

Type: object

The position of the rider

Type: object

order-delivered

Type: object

Fired when a delivery is successfully completed.

Type: const
Specific value: "order_delivered"

Type: stringFormat: date-time

the time the delivery was completed

Type: string

Type: string

Type: string

Type: enum (of string)

Must be one of:

  • "CONSUMER"
  • "DOORMAN"
  • "RECEPTIONIST"
  • "CONSUMER_DOOR"

Type: object

Type: object

Type: object

Type: string

URL to consumer signature POD if collected.

Type: string

URL to consumer photo POD if collected.

Type: string

URL to JSON output of barcode ID scan if required and completed successfully

Type: string

URL to photo of consumer ID if barcode scan failed and manual review of consumer ID was needed

order-delivery-failed

Type: object

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

Type: const
Specific value: "order_delivery_failed"

Type: stringFormat: date-time

the time that the delivery was marked as failed

Type: object

Type: enum (of string) Default: "Unknown Reason"

Must be one of:

  • "Order Damaged"
  • "Consumer Refused"
  • "Consumer Not At Home"
  • "Customer Not Reachable"
  • "Address Incorrect"
  • "Unknown Reason"
  • "Wrong Order"

order-delivery-returned

Type: object

Fired when a delivery is successfully returned.

Type: const
Specific value: "order_delivery_returned"

Type: stringFormat: date-time

the time the delivery was returned

Type: object

rider-accepted

Type: object

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.

Type: const
Specific value: "rider_accepted"

Type: stringFormat: date-time

the time the rider accepted the job.

Type: string

Type: string

Type: string

Type: string

The name of the rider. Suitiable for display purposes.

Type: string

URL to the rider's photo if available

Type: enum (of string)

Must be one of:

  • "BIKING"
  • "DRIVING"

Type: object

the phone numbers for the consumer and producer to contact the rider (texts and calls supported).

Type: string

the phone number is associated with the consumer's phone provided when creating the order

Type: string

the phone number is associated with the producer's phone provided when creating the order.

rider-location

Type: object

Fired when the rider location has changed.

Type: const
Specific value: "rider_location"

Type: stringFormat: date-time

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

rider-cancelled

Type: object

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.

Type: const
Specific value: "rider_cancelled"

Type: stringFormat: date-time

the time the rider cancelled the job.

Type: string

Type: string

Type: string

order-details-edited

Type: object

Fired when some fields unrelated to delivery status are updated. For example, a phone number or specialInstructions edit.

Type: const
Specific value: "order_details_edited"

Type: stringFormat: date-time

The time the order was edited.

Type: object

Type: array of object

A list of changes made to the original order.

No Additional Items

Each item of this array must be:

Type: object

Type: enum (of string)

Must be one of:

  • "ADD"
  • "REMOVE"
  • "UPDATE"

Type: string

The path of the field that was changed. For example, "consumer.name" or "consumer.location.coordinates.latitude".

order-delivery-path

Type: object

Fired when the rider location has changed. Includes GeoJSON attributes to render delivery path and rider's progress on path.

Type: const
Specific value: "order_delivery_path"

Type: stringFormat: date-time

Type: object

Type: object

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.

Type: object

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.

Type: object

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.

Type: object

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.