For: Developers.
We leverage webhooks to notify you of events that may or may not require you to take action. For instance, we will send you a webhook notification for a "delivery created" event. After which you will either "accept" or "reject" the delivery. All webhooks are enumerated in the Events section below.
All webhook requests will be made using the POST HTTP verb. In addition to the signature header used for authentication we will also set the following headers:
X-ezCater-Event- a string identifier for the webhook event type (possible events listed below)X-ezCater-Request-Id- a v4 uuid identifier for the webhook request; this is useful for debugging requestsContent-Type- will have the valueapplication/json
Setup
You will provide us with an endpoint hosted by your application to which we will make requests. We will provide you with an API secret. This is used to validate each request signature guaranteeing the security and validity of the requests we send to you.
Signature
The request signature will be in the X-ezCater-Signature header. It will have the form:
integer_timestamp.signature_payload
The signature_payload is hashed using SHA256 along with the webhook API secret that we've provided to you. When verifying the signature, the data should be formatted as:
integer_timestamp.request_body
If the hash that is produced matches the original signature_payload then the signature, and therefore the request, are valid.
NOTE: The request_body must be the raw/unserialized JSON string.
Events
This section lists the webhook event names, header event type identifier, and the request payload body.
DeliveryCreated - event type header identifier:
delivery_createdDeliveryModified - event type header identifier:
delivery_modifiedsame payload as
delivery_createdDeliveryCancelled - event type header identifier:
delivery_cancelled
Example delivery_created Payload
{
"id": "uuid",
"order": {
"subtotal": "float",
"itemCount": "int",
"itemDescriptions": ["string"],
"orderNumber": "string",
"tipCents": "int",
"forRelish": "boolean"
},
"pickupAddress": {
"id": "uuid",
"locationName": "string" | null,
"instructions": "string" | null,
"street1": "string",
"street2": "string" | null,
"street3": "string" | null,
"city": "string",
"state": "string",
"zip": "string",
"phone": "string",
"latitude": "float",
"longitude": "float"
},
"assignmentStatus": "string",
"deliverySetup": "string" | null,
"dropoffAddress": "object (same as above)",
"dropoffContacts":[
{
"name":"string",
"phone": "string"'
"phoneExtenstion": "string"
}
],
"distanceInMiles": "string",
"driverAskFor": "string",
"eventAt": "iso8601",
"pickupAt": "iso8601" | null,
"pickupInstructions": "string" | null,
"priority": "string",
"timeZoneIdentifier": "iso8601",
"createdAt": "iso8601",
"updatedAt": "iso8601",
"pickupVerification": {
"readyForPickupImageUrl": "string" | null
} | null
}
Example delivery_cancelled Payload
{
"id": "uuid",
"cancelledAt": "iso8601",
"reason": "string",
}