B2B Ninja Docs

Webhooks

Webhooks

Webhooks (also called a web callback or HTTP Push API) are part of most advanced API systems, and it allow you to connect two systems with the ability to update them in real time. Compared to polling an API on an interval, webhook allows an application to push the data to your system as soon as an event takes place. This has a couple of benefits, it provides a more responsive experience while also being more efficient.

To use webhooks, your B2B Ninja account will need to have API Access enabled. This feature is included in our Enterprise plan. Please contact us for a quote if you would like API access on another plan.

Events scope

  • Quote - Created: quote:created
  • Quote - Sent quote:sent
  • Quote - Email Added quote:email-added
  • Quote - Tagged quote:tag-added
  • Quote - Tag Removed quote:tag-removed
  • Quote - Order Placed order:placed

Configuring using the UI

It's easy to setup a webhook within quote ninja. Just paste in the URL that you want B2B Ninja to send a HTTP POST request to when the event happens. The only requirement is that the URL be secured and start with https://

  1. Go to the API settings tab and scroll to the webhooks section
  2. Enable the webhook event that you want to use by clicking the checkbox
  3. Paste in the URL that you want B2B Ninja to send the POST request to
  4. Click Apply Changes button at the top right

Configuring using the API

The hooks reference has the details on how you can create, update and delete the hooks via the REST API.

You can secure the webhook with a secret that only you and B2B Ninja share. If set, we will pass this secret to your system with every webhook via the header qn-secret. The header key will be qn-secret and the value will be the secret you set. Your server can filter out requests that don't have the secret set.

Security via UI

Security via API

This can be set when creating/updating a webhook by passing it in the object using the secret key.

Example:

{
"destination": "https://your-server-or-integration.com/route",
"active": true,
"secret": "provide your secret key here"
}

Notes

Since webhooks happen when an action takes place, if your service is not available to handle the request or has an error while processing the request, data loss may occur. B2B Ninja does not have a retry on failure system, so you will need to ensure that the connection is working so that data does not go out of sync.

We also have Zapier integration in BETA with triggers that correspond to webhooks that allow you to integrate with other systems easily. If you would like to use this, please contact support to give you access.