Webhooks

Webhooks allow you to build or set up integrations which are notified when your account receives an order.

Order details webhook

When an order is received, we'll send a HTTP POST payload to the webhook's configured URL.

Order status webhook

When an order is marked as completed, open, canceled or uncanceled, we'll send a HTTP POST payload to the webhook's configured URL.


Configuring Webhooks

Webhooks can be configured by:

  • logging into your online ordering account
  • browsing to Restaurant Manager
  • then Restaurant Locations.
  • For the location you wish to setup a webhook for, click the Change This link beside Currently Receives Orders By
  • On the Order Notifications page:
    • For Order Details webhook check the box for I want to receive a webhook containing the order details and enter your webhook URL.
    • For Order Status webhook check the box for I want webhooks when the order status changes and enter your webhook URL.

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 Order Details 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"
  },
  "invoiceAmount": 10,
  "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.
restaurantInfo
required
Object Contains details about the restaurant the order was placed at.
id
required
Integer The ID of the restaurant.
name
required
String The name of the restaurant.
phone
required
String The phone number of the restaurant.
address
required
String The address of the restaurant.
addressInfo
required
Object Contains details of the restaurant's address.
street1
required
String The street address of the restaurant.
street2
optional
String The second line of the restaurant address.
suite
optional
String The suite line of the restaurant address.
city
required
String The city the restaurant.
state
required
String The state of the restaurant.
zip
required
String The zip/postal code 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.
deliveryAddressInfo
required
Object Contains details of the delivery address.
companyName
required
String The company name associated with the delivery address.
street1
required
String The street address of the delivery address.
street2
optional
String The second line of the delivery address.
suite
optional
String The suite line of the delivery address.
city
required
String The city the delivery address.
state
required
String The state of the delivery address.
zip
required
String The zip/postal code of the delivery address.
crossStreet
optional
String The cross street of the delivery address.
latitude
required
Float The latitude of the delivery address. May be 0.0 if the latitude for the address is unknown.
longitude
required
Float The longitude of the delivery address. May be 0.0 if the longitude for the address is unknown.
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 Pick up/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.
invoiceAmount
optional
Currency The restaurant's invoice amount
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 Pick up/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.

Receiving Order Status Webhooks

When an order is marked as completed, open, canceled or uncanceled, we'll send an HTTP POST payload to the webhook's configured URL.

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

Example

					{
  "account_id": 1234,
  "restaurant_id": 555,
  "order_id": 36544,
  "status": "completed"
}
					
				

Reference

account_id
required
Integer The account ID.
restaurant_id
required
Integer The restaurant location ID.
order_id
required
Integer The Customer Order ID.
status
required
String Order's status was changed to this value. Possible values: open, completed, canceled, uncanceled

API

Configuring and Sending Requests

For all API calls below, send GET requests with the following headers:

					'headers' => [
	'accept' => 'application/json',
	'content-type' => 'application/json',
	'api-key' => {YOUR API KEY},
	]
				

Note: You can find your API Key at the bottom of your admin dashboard by clicking on "API Key & Menu Update Webhook"

GET Restaurant locations List

https://onlineorderingsecure.com/api/1.0/restaurant/list

Returns a list with your restaurant locations

{
  "results": [
    {
      "id": 1234,
      "name": "Classic Pizza"
    },
    {
      "id": 12345,
      "name": "Pizza Xpress"
    }
  ]
}

GET Menu

https://onlineorderingsecure.com/api/1.0/restaurant/{restaurant_id}/menu

Returns a restaurant location's menu data

[
   {
       "id": 1,
       "name": "Main Menu",
       "url_tag": "main-menu",
       "private_tag": "",
       "description": "Description",
       "is_hidden": false,
       "always_available": true,
       "activate_at": "0000-00-00 00:00:00",
       "deactivate_at": "0000-00-00 00:00:00",
       "use_daily_hours": false,
       "start_time": "05:00:00",
       "end_time": "05:00:00",
       "hours": {
           "Monday": {
               "open": "00:00:00",
               "close": "00:00:00",
               "unavailable": false
           },
           "Tuesday": {
               "open": "00:00:00",
               "close": "00:00:00",
               "unavailable": false
           },
           "Wednesday": {
               "open": "00:00:00",
               "close": "00:00:00",
               "unavailable": false
           },
           "Thursday": {
               "open": "00:00:00",
               "close": "00:00:00",
               "unavailable": false
           },
           "Friday": {
               "open": "00:00:00",
               "close": "00:00:00",
               "unavailable": false
           },
           "Saturday": {
               "Open": "00:00:00",
               "close": "00:00:00",
               "unavailable": false
           },
           "Sunday": {
               "open": "00:00:00",
               "close": "00:00:00",
               "unavailable": false
           }
       },
       "categories": [
           {
               "id": 1,
               "name": "Pizzas",
               "description": "Create your own pizza by adding toppings that you crave!",
               "url_tag": "pizzas",
               "private_tag": "",
               "min_items_required_per_order": 0,
               "max_items_available_per_order": 0,
               "items": [
                   {
                       "id": 2,
                       "name": "Extra Large 16\" Pizza",
                       "description": "Order a Cheese Pizza or Add toppings for $1.30 each.",
                       "url_tag": "extra-large-16-pizza",
                       "is_shown": true,
                       "is_taxable": true,
                       "tax_rate": 0,
                       "tax_rate_label": "Custom Tax Rate Label",
                       "min_prep_time": 0,
                       "min_required_per_order": 1,
                       "max_available_per_order": 0,
                       "available_order_types": 7,
                       "is_unavailable": false,
                       "is_orderable": true,
                       "is_pizza": true,
                       "has_single_price": false,
                       "prices": [
                           {
                               "name": "Extra Large 16\" Pizza",
                               "value": 1099,
                               "price_value_by_extra_count": "",
                               "nutritional_info": null,
                               "is_shown": true
                           }
                       ],
                       "hide_special_instructions": false,
                       "modifier_groups": [
                           {
                               "id": 0,
                               "name": "No group",
                               "modifiers": [
                                   {
                                       "id": 1,
                                       "name": "Pepperoni",
                                       "private_tag": "",
                                       "price_value": 130,
                                       "half_price_value": 70,
                                       "show_pizza_options": true,
                                       "price_per_addon_count": 1,
                                       "type": "extra",
                                       "is_preselected": false,
                                       "hide_on_order_sheet": false
                                   },
                                   {
                                       "id": 2,
                                       "name": "Sausage",
                                       "private_tag": "",
                                       "price_value": 130,
                                       "half_price_value": 70,
                                       "show_pizza_options": true,
                                       "price_per_addon_count": 1,
                                       "type": "extra",
                                       "is_preselected": false,
                                       "hide_on_order_sheet": false
                                   },
                                   {
                                       "id": 3,
                                       "name": "Ham",
                                       "private_tag": "",
                                       "price_value": 130,
                                       "half_price_value": 70,
                                       "show_pizza_options": true,
                                       "price_per_addon_count": 1,
                                       "type": "extra",
                                       "is_preselected": false,
                                       "hide_on_order_sheet": false
                                   }
                               ]
                           }
                       ]
                   }
               ]
           }
       ]
   }

Menus Reference

id
Integer The order ID.
name
String The name of the menu.
url_tag
String The URL of the menu
private_tag
String Private tag
description
String Description
is_hidden
Boolean true if menu is hidden, false otherwise
always_available
Boolean true if menu is always available, false otherwise
activate_at
DateTime Date and time when the menu becomes available
deactivate_at
DateTime Date and time when the menu becomes unavailable
use_daily_hours
Boolean true if menu uses "advanced availability" (different hours for each day), false otherwise
start_time
Time Daily starting time for the menu
end_time
Time Daily closing time for the menu
hours
Array
Monday
Object Week day name
open
Time hh:mm format
close
Time hh:mm format
unavailable
Boolean true if it's closed all day, false if using above hours
Tuesday
Object Week day name
open
Time hh:mm format
close
Time hh:mm format
unavailable
Boolean true if it's closed all day, false if using above hours
Wednesday
Object Week day name
open
Time hh:mm format
close
Time hh:mm format
unavailable
Boolean true if it's closed all day, false if using above hours
Thursday
Object Week day name
open
Time hh:mm format
close
Time hh:mm format
unavailable
Boolean true if it's closed all day, false if using above hours
Friday
Object Week day name
open
Time hh:mm format
close
Time hh:mm format
unavailable
Boolean true if it's closed all day, false if using above hours
Saturday
Object Week day name
open
Time hh:mm format
close
Time hh:mm format
unavailable
Boolean true if it's closed all day, false if using above hours
Sunday
Object Week day name
open
Time hh:mm format
close
Time hh:mm format
unavailable
Boolean true if it's closed all day, false if using above hours
categories
Array Contains details about the menu's categories
id
Integer The ID of the category
name
String The name of the category
description
String Description
url_tag
String The url of the category
private_tag
String Private tag
min_items_required_per_order
Integer Minimum number of items required from this category when placing an order
max_items_required_per_order
Integer Maximum number of items required from this category when placing an order
items
Array The menu items in this category
id
Integer The ID of the menu item
name
String The name of the menu item
description
String Description
url_tag
String The url of the menu item
is_shown
Boolean true or false
is_taxable
Boolean true or false
tax_rate
Integer Tax rate %
tax_rate_label
String Tax rate name/label
min_prep_time
Integer Minimum preparation time
min_required_per_order
Integer Minimum quantity required when ordering this item
max_available_per_order
Integer Maximum quantity when ordering this item
available_order_types
Integer 1 - Pickup, 2 - Delivery, 3 - Pickup & Delivery, 4 - Dine-in, 5 - Pickup & Dine-in, 6 - Delivery & Dine-in, 7 - Pickup, Delivery & Dine-in
is_unavailable
Boolean true or false
is_orderable
Boolean true or false
is_pizza
Boolean true or false, used to do toppings/extras on half of the pizza
has_single_price
Boolean true or false, the item only has 1 price
hide_special_instructions
Boolean true or false, hide the special instructions field
prices
Array The prices for this menu item
name
String Name
value
Integer Price value in cents
price_value_by_extra_count
String Price value by extra count
nutritional_info
String Nutritional info
is_shown
Boolean true or false, visible to customers
modifier_groups
Array The menu items in this category
id
Integer ID
name
String Name
modifiers
Array The menu item's modifiers
id
Integer ID
name
String Name
private_tag
String Private tag
price_value
Integer Price value in cents
half_price_value
Integer Half price value in cents
show_pizza_options
Boolean true or false
price_per_addon_count
Integer Price per number of addons
type
String "option", "extra" or "topping"
is_preselected
Boolean true or false, ithe modifier is selected by default
hide_on_order_sheet
Boolean true or false, hide this addon on the order sheet
modifiers
Array The children modifiers for this modifier - same structure as above

Menu Update Webhook

If you want to receive a notification whenever your menu is updated, add a url in the "Menu Update Webhook" field in your admin

You will receive a POST request every time your menu is updated, in the following format:

{
	"account_id": 1234,
	"name": "Classic Pizza"
}

When you receive this request simply do an API call to https://onlineorderingsecure.com/api/1.0/restaurant/{restaurant_id}/menu to get the menu data as shown above.