Webhooks

Webhooks allow you to build or set up integrations which are notified when your account receives an order. When an order is received, we'll send a HTTP POST payload to the webhook's configured URL.


Configuring Webhooks

Webhooks can be configured by:

You can also send test webhooks from the Notifications page. Note that these test webhooks do not correspond to actual orders or customers.


Responding to Webhooks

To acknowledge successful receipt of the webhook, your endpoint should return a 200 HTTP status code. Any other status code indicates the webhook was not successfully received.

If a webhook does not receive a successful response, we will continue trying to send the webhook with the following schedule: 1 minute, 2 minutes, 5 minutes, 10 minutes. We will then continue retrying every 10 minutes until approximately 2 hours have passed since the original attempt.

When logged into your online ordering account, you can lookup past webhooks and manually retry a webhook in the Reporting area.


Receiving Webhooks

Note that webhook endpoints may receive an order event more than once. Your endpoint should contain logic to handle processed orders.

The webhook data is sent in application/json format with a JSON formatted payload in the Raw POST Body.

Webhooks are sent for 2 order types: CustomerOrder and GroupOrder

Note the example below does not include all optional fields. Refer to the definition below to see all possible fields.

All monetary values are returned as Integers representing the number of cents. For example, $25.47 will be represented as 2547.

CustomerOrder Example

{
  "type": "CustomerOrder",
  "id": 235467,
  "account": 96578,
  "restaurant": 3476,
  "createdAt": "2016-09-20T20:32:14+00:00",
  "readyAt": "2016-09-20T21:02:14+00:00",
  "orderType": "PICKUP",
  "customer": {
    "name": "John Doe",
    "currentPhone": "(234) 567-8900",
    "email": "john@doe.com"
  },
  "totalPrice": 5385,
  "taxAmount": 310,
  "taxRate": 6.1,
  "taxLabel": "Local",
  "tipAmount": 0,
  "payment": {
    "methodId": 7,
    "description": "Customer is paying by Cash on Delivery/Pickup"
  },
  "specialInstructions": "",
  "items": [
    {
      "id": 967644,
      "category": "Appetizers",
      "name": "Chicken Wings",
      "for": "Me",
      "priceName": "10 Wings",
      "priceId": 837482,
      "priceValue": 1200,
      "quantity": 1,
      "totalPrice": 1200,
      "specialInstructions": "",
      "addons": [
        {
          "id": 6567,
          "priceValue": 0,
          "quantity": 1,
          "totalPrice": 0,
          "name": "Wing Sauce",
          "optionChoiceName": "Extra Hot",
          "optionChoiceId": 2432
        }
      ]
    },
    {
      "id": 6589,
      "category": "Create Your Own Pizza",
      "name": "Medium Pizza",
      "for": "Me",
      "priceName": "Medium Pizza",
      "priceId": 4563,
      "priceValue": 1025,
      "quantity": 2,
      "totalPrice": 2720,
      "specialInstructions": "Light on the sauce please",
      "addons": [
        {
          "id": 720,
          "priceValue": 225,
          "quantity": 2,
          "totalPrice": 450,
          "name": "Sliced White Onions",
          "pizzaChoice": "W"
        },
        {
          "id": 707,
          "priceValue": 110,
          "quantity": 2,
          "totalPrice": 220,
          "name": "Fresh Italian Sausage",
          "pizzaChoice": "L"
        }
      ]
    }
  ]
}

CustomerOrder Reference

type
required
String This describes the object received. CustomerOrder for Orders.
id
required
Integer The order ID.
customId
optional
Integer The account specific order ID. Only provided when the account has custom order numbering enabled.
account
required
Integer The ID of the account.
restaurant
required
Integer The ID of the restaurant.
createdAt
required
ISO-8601 DateTime When the order was placed.
readyAt
required
ISO-8601 Datetime When the order is due to be ready/delivered to the customer.
orderType
required
String The selected order type. Will be one of: PICKUP, DELIVERY, DINEIN.
customer
required
Object Contains information about the ordering customer:
name
required
String The customer's name.
currentPhone
required
String The current phone number as entered by the customer during checkout.
email
required
String The customer's email.
company
optional
String The customer's company name.
totalPrice
required
Currency The total price of the order.
taxAmount
optional
Currency The amount of tax on the order.
taxRate
optional
Float The tax rate applied to the order.
taxLabel
optional
String The custom text describing the tax.
taxAmount2
optional
Currency The amount of the second tax on the order.
taxRate2
optional
Float The second tax rate applied to the order.
taxLabel2
optional
String The custom text describing the second tax.
taxExempt
optional
Boolean True if the customer is marked as Tax Exempt.
tipAmount
required
Currency The amount of the tip (gratuity).
couponId
optional
Integer The ID of the coupon applied to the order.
couponAmount
optional
Currency The value of the coupon.
couponName
optional
String The name of the coupon.
deliveryChargeAmount
optional
Currency The delivery charge.
deliveryAddress
optional
String The address where the order is to be delivered.
deliveryNote
optional
String Any special notes regarding the delivery address.
deliveryDistance
optional
Float The calculated distance between the restaurant and the delivery address.
deliveryDistanceUnit
optional
String The unit the deliveryDistance is. Either kilometers or miles.
creditCardFee
optional
Currency The fee charged for paying by credit card.
payment
optional
Object Contains information about the selected payment method:
methodId
required
Integer The ID of the chosen payment method. Can be
  • 1 - Pay at time of pickup/delivery
  • 2 - Pay with Credit Card
  • 6 - Pay with House Account
  • 7 - Pay with Custom Payment Method
  • 8 - Pay with PayPal
description
required
String A description of the selected payment method.
houseAccountId
optional
String The House Account as provided by the customer.
specialInstructions
optional
String The Special Instructions provided by the customer.
items
required
Array Contains the ordered items. Each element in the array contains an Item with the properties below:
id
required
Integer The ID of the ordered item.
category
required
String The name of the category the item was ordered from.
name
required
String The item's name.
for
required
String The name of the person who the item is for.
priceName
required
String The name of the selected price level.
priceId
required
Integer The ID of the selected price level.
priceValue
required
Currency The per quantity value of the item.
quantity
required
Integer The quantity ordered.
priceNote
optional
String A description of any overridden prices.
totalPrice
required
Currency The total price of the item, including addons.
specialInstructions
required
String The Special Instructions for the item provided by the customer.
addons
required
Array Contains the options/extras/addons for the item. Each element in the array contains an Addon with the properties below:
id
required
Integer The ID of the addon.
priceValue
required
Currency The per quantity value of the addon.
quantity
required
Integer The quantity ordered.
totalPrice
required
Currency The total price for this addon.
name
required
String The name of the addon.
optionChoiceName
optional
String When addon has multiple choices, this is the name of the selected option.
optionChoiceId
optional
String When addon has multiple choices, this is the ID of the selected option.
pizzaChoice
optional
String Can be one of L, R OR W, representing Left, Right, Whole. This is provided when the Item is a pizza type and the customer can choose for the addon to be on only half the Item.

GroupOrder Reference

type
required
String This describes the object received. GroupOrder for GroupOrders.
id
required
Integer The group order ID.
account
required
Integer The ID of the account.
restaurant
required
Integer The ID of the restaurant.
createdAt
required
ISO-8601 DateTime When the order was placed.
readyAt
required
ISO-8601 Datetime When the order is due to be ready/delivered to the customer.
orderType
required
String The selected order type. Will be one of: PICKUP, DELIVERY, DINEIN.
customer
required
Object Contains information about the ordering customer:
name
required
String The customer's name.
currentPhone
required
String The current phone number as entered by the customer during checkout.
email
required
String The customer's email.
company
optional
String The customer's company name.
totalPrice
required
Currency The total price of the order.
deliveryAddress
optional
String The address where the order is to be delivered.
deliveryNote
optional
String Any special notes regarding the delivery address.
individualPayments
optional
Boolean true if each component order is making their own payment. false if the group originator is paying for all component orders.
payment
optional
Object Contains information about the selected payment method:
methodId
required
Integer The ID of the chosen payment method. Can be
  • 1 - Pay at time of pickup/delivery
  • 2 - Pay with Credit Card
  • 6 - Pay with House Account
  • 7 - Pay with Custom Payment Method
  • 8 - Pay with PayPal
description
required
String A description of the selected payment method.
houseAccountId
optional
String The House Account as provided by the customer.
orders
required
Array Contains the component orders. Each element in the array is a CustomerOrder as described above.