Wiki

Clone wiki

Webhook Connector / Home

About the Univsersal Webhook Connector Extension

This module enables you to send out webhooks from your Magento 2 installation on specific events, resulting in automatic integrations with REST compatible endpoints.

How it works

Whenever your webshop triggers an action which our webhook extension catches, the webhook is placed in the queue. Every minute Magento processes the queue and sends out a selection of webhooks based on priorities.

If the delivery of the webhook was unsuccessful, Magento will keep on trying to send it and will provide feedback about the failed attempt in the Audit Log of the extension.

The extension also allows you to trigger Magento to send all historical data, which was already in the system. This allows you to send older Customers and Orders, Categories and Products to your external system.

The historical queue runs separately from the regular queue, which ensures live data is always properly sent even though the historical process may be running aswell.


Features

  • Send live data from your webshop directly to your REST compatible endpoints
  • Supports Customer, Quote, Order, Category and Product data
  • The queue prioritizes all items and sends the most important items first
  • Send historical data from Magento to your external system
  • Delivery monitoring - Any failures are automatically requeued
  • Different endpoint per type
  • Verbose logging for webhooks after they have been sent out
  • HMAC Security for webhooks
  • Magento and Extension version headers
  • Setup an integration ID to identify Magento against your RESTful interface

The Queue - Why is it used?

To ensure we are always able to requeue any data which may fail and have a consistent way of doing that, the system is not sending out live webhooks right away but pushing it on top of the queue.

Theres 2 main reasons for this approach:

  1. Consistency by using one straight forward approach for webhooks makes it easily maintainable.

  2. Load Management by ensuring we threshold webhooks when it's very busy on the website. In this way there's never to much webhooks sent during busy moments. Since live webhooks are always sent by importancy, you will never miss out on imporant webhooks sent to your external system.


Queue Priorities

  1. Customers
  2. Carts and Orders
  3. Categories and Products

Installation

Step 1 - Installing the extension

Composer Installation: Contact us to get a token for your composer installation

Add our Repository

composer config --global --auth http-basic.teamwizkunde.repo.packagist.com token <your token>

Install the extension

composer config repositories.webhooks composer https://teamwizkunde.repo.packagist.com/<your customer name>/

Alternative Installation: Download and unpack the module

The module is in Marketplace format. Therefor, you need to do the following to install it:

Go to your project root and execute the following:

cd /your-project-root
mkdir -p app/code/Wizkunde/Webhooks
cd app/code/Wizkunde/Webhooks
tar -zxvf Wizkunde_Webhooks-<version>.tgz

Step 2: Run the Magento installer

bin/magento setup:upgrade

setup-upgrade.png

Step 3: If you were in production mode you have to execute:

bin/magento setup:di:compile

Step 4: Deploy all the template files to the proper location:

bin/magento setup:static-content:deploy

Step 5: Make sure all the caches are cleaned

Run: bin/magento cache:clean


Configuration

Go to: Stores-> Configuration -> Wizkunde Configuration -> Webhooks Configuration

General Settings

Enable Webhooks -> If set to no, all webhooks for that scope are disabled

Wizkunde Integration Identifier -> The identifier of which your REST endpoint identifies the webshop

Enable Webhooks Log -> Enable logging of outgoing webhooks

Log Severity -> Choose between logging failed or all outgoing webhooks

webhooks-general.JPG


Security Settings

HMAC Secret -> The secret which will be used to calculate the HMAC value

webhooks-security.JPG


Webhook Settings

Endpoint - Checkouts -> The endpoint where quotes are going to be sent

Endpoint - Customers -> The endpoint where customers are going to be sent

Endpoint - Orders -> The endpoint where orders are going to be sent

Endpoint - Categories -> The endpoint where categories are going to be sent

Endpoint - Products -> The endpoint where products are going to be sent

webhooks-endpoints.JPG


Historical Endpoints

Send an authenticated request to these endpoints:

  • GET /wizkunde/historical - Triggers the start of the historical sync
  • GET /wizkunde/historical/:type - Triggers the start for just one type
  • GET /wizkunde/stop - Stops historical and flushes the historical queue
  • GET /wizkunde/stop/:type - Stops the historical and flushes the queue for just one type

Updated