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 Paytronix Order & Delivery 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. Once you're set up you will be sent a link to your integration management page, where you can configure your integration and view webhook logs.

Property Description
action Determines the type of request being made, including whether a response is expected.
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",
            "pos":"3782",
            "price":0,
            "is_default":false,
            "is_disabled":false,
            "option_name":"Green Olives",
            "quantity":1,
            "group_name":"v52",
            "base_price":1.3
          },
          {
            "name":"v52: Pineapple",
            "pos":"1927",
            "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"
  }
}

Request Types

We can send several different types of requests per order. Request types are determined by the action field.

Action Description Response
new_order A new order that is ready to be processed.

Any 200-level HTTP response.

After processing the order, the POS Acknowledgement API may be called to acknowledge the order, and the POS Confirmation API may be used for orders to be manually confirmed by restaurant staff.

is_online A check ensuring that the POS system is online and ready to receive an order.

A JSON response with an online boolean property indicating whether the POS is online.

{
  "online": true
}
validate_order A new order pending validation.

A JSON response with a valid_order boolean property indicating whether the order is valid.

{
  "valid_order": true
}

Order Schema