Webhooks: HTTP Notifications

Paytronix Order & Delivery supports order injection via webhooks, where an HTTP POST notification with order information is sent to the third-party integrator upon order submission. Order injection webhooks can be either integrator-level or store-level.

Integrator-Level Webhooks

When integrator-level webhooks are used, a single URL is configured for all merchants and stores that use the integration. This method is the simplest and most streamlined integration path. The integrator can either use the Paytronix store/restaurant ID or a configured store-level ID to determine the appropriate store for the order.

Store-Level Webhooks

If the integrator needs a separate webhook URL for each store, Paytronix supports store-level webhooks. In this case, a distinct, full URL must be configured for each store. This creates additional flexibility for the integrator, but require additional work in the setup process to configure the URLs.

Webhook Authentication

Webhooks sent by Paytronix will include a shared secret for authentication, as a bearer token in the Authentication header. This token is specific to webhook authentication, and is not used in any other places.

The HTTP header will be as follows: Authorization: Bearer <SHARED_BEARER_TOKEN>

Configuring Webhooks

Currently, webhooks must be configured by the Open Dining support team. Shoot an email to help@opendining.net with the full URL and restaurant name that you'd like to receive webhook notifications, and we'll set it up for you.

Property Description
action For orders, this will always be new_order
order The order ID
restaurant The restaurant ID
order_data This field contains the entire order's contents. See the API Reference for detailed descriptions of each field.

Request Body Example:

{
  "action":"new_order", 
  "restaurant":"5f1b223c51e2d31e007b23d8",
  "order":"5f5009563f8cc37da3a02a2a",
  "order_data" : {
    "restaurant":"5f1b223c51e2d31e007b23d8",
    "name":"Test Restaurant",
    "creation_time":1599080790,
    "status":"Submitted",
    "s":1,
    "paid":0,
    "type":"takeout",
    "short_id":157,
    "submit_url":"https:\/\/od.odn\/submit\/5f5009563f8cc37da3a02a2a",
    "order_date":"09\/03\/2020",
    "eta":"9:30 AM","ordering_for":"later",
    "currency":"USD",
    "fee":0,
    "time":20,
    "app_id":"5f1b223b51e2d31e007b23d6",
    "delivery_fee":0,
    "active_taxes":[],
    "donation":0,
    "subtotal":20.99,
    "tax":"0",
    "tip":0,
    "total_amount":20.99,
    "items":[
      {
        "id":"5f5009643f8cc37ca3a02a2b",
        "menuitem":"5f4d343f8a4bc315007b2430",
        "name":"Italian Grinder - House Specialty",
        "quantity":1,
        "options":[
          {
            "name":"v52: Green Olives",
            "price":0,
            "is_default":false,
            "is_disabled":false,
            "option_name":"Green Olives",
            "quantity":1,
            "group_name":"v52",
           "base_price":1.3
          },
          {
            "name":"v52: Pineapple",
            "price":0,
            "is_default":false,
            "is_disabled":false,
            "option_name":"Pineapple",
            "quantity":1,
            "group_name":"v52",
            "base_price":1.3
          }
        ],
        "category":"Pizzas",
        "price":10.5,
        "total_price":10.5,
        "size":"1\/4"
      },
      {
        "id":"5f5009653f8cc37ca3a02a2c",
        "menuitem":"5f4d343f8a4bc315007b2430",
        "name":"Italian Grinder - House Specialty",
        "quantity":1,
        "category":"Pizzas",
        "price":10.49,
        "total_price":10.49,
        "size":"1\/4"
      }
    ],
    "combos":[
      {
        "id":"5f5009643f8cc37ca3a02a2a",
        "name":"Combo Test",
        "combo_item_id":"5f4d343f8a4bc315007b2440"
      }
    ],
    "c":1,
    "customer_name":"Paytronix Order Delivery",
    "customer_phone":"8042221111",
    "due_timestamp":1599139800,
    "fields":[],
    "submit_time":1599080848,
    "u":"help@opendining.net",
    "id":"5f5009563f8cc37da3a02a2a"
  }
}

Order Schema