# Webhook Event Publishing

Here you can find an overview of the Emporix Webhook Service, along with its features and benefits.

{% hint style="info" %}

* Looking for code tutorials? Check out the [Webhook Service guide](https://app.gitbook.com/s/d4POTWomuSS7d3dnh4Dg/api-guides/webhooks/webhook-service/webhooks-tutorial).
* Looking for API reference? Check out the [Webhook Service](https://app.gitbook.com/s/d4POTWomuSS7d3dnh4Dg/api-guides/webhooks/webhook-service) in the Emporix API Reference.
  {% endhint %}

### Purpose

To move towards an event-driven architecture, we are introducing the Webhook Event Publishing functionality. This feature, implemented through the Emporix API Webhook Service, allows external systems to subscribe to internal events published by the Commerce Engine. Thanks to the Webhook Service, you do not need to call specific API endpoints to look for recent changes in services — you will be automatically notified instead.

### Features

The Webhook Service introduces the following features:

| Feature                           | Description                                                                                                                                                                                                                                                                     |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Events**                        | All actions that take place in the Emporix API are considered events. For example, creating and updating a catalog in the Emporix API Catalog Service are both considered events.                                                                                               |
| **Event subscription management** | You can manage notifications for your Emporix tenant by subscribing to and unsubscribing from particular events.                                                                                                                                                                |
| **Event Gateway**                 | The Event Gateway is a dashboard where you pre-configure endpoints to receive notifications about events you have subscribed to in the Webhook Service. The Event Gateway acts as an intermediary, as it passes notifications from the Webhook Service directly to your tenant. |
| **Statistics**                    | You can retrieve statistics for the Shared Account strategy on the number of events successfully sent to the endpoints that you earlier configured in the Event Gateway.                                                                                                        |
| **Strategy configuration**        | Possible to configure within the Emporix Management Dashboard if Shared Account, Licensed Account - Svix, or Other - HTTP strategy is used.                                                                                                                                     |
| **Specific Target URLs**          | For the Other - HTTP strategy, it is possible to define different target URLs for different events.                                                                                                                                                                             |

#### Webhooks strategies

You can apply one of the following strategies to your tenant:

* Svix-Shared - default strategy allowing you to use the shared Svix subscription offered by Emporix
* Svix - strategy that allows you to connect your own Svix licence
* HTTP - strategy that provides possibility to receive events notification as HTTP requests to a declared URL

### Overview

The Emporix Webhook Event Publishing process consists of the following sequence of events:

1. When an event that you subscribed to takes place, a message is sent to the Webhook Service.
2. The Webhook Service forwards the message to the Event Gateway.
3. The Event Gateway passes the event to your pre-configured endpoint for this particular event.

{% hint style="success" %}
For example, if a catalog is created in the Emporix environment, a notification is sent to the Webhook Service. The service passes the message to the Event Gateway. If you configured the `Create a new catalog` endpoint beforehand, you will receive the notification from the Event Gateway that a new catalog has been created.
{% endhint %}

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-e4e98db6926643724f99ac361bfccef5e0483e1f%2Fwebhooks.drawio.svg?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
With the Svix-shared strategy, the maximum number of events per tenant is limited to 5000/month. The limit resets on the first day of each month. After you exceed the set limit, the requests do not get sent. For further information about the limits, please contact the Sales department at <sales@emporix.com>.
{% endhint %}

{% hint style="info" %}
For more information about webhooks usage, see [Webhooks](https://developer.emporix.io/ce/management-dashboard/administration/webhooks).\
For more information on HMAC configuration, see [HTTP Webhook Strategy - HMAC Configuration](https://developer.emporix.io/ce/system-management/webhooks-user-guide/hmac-configuration).\
To see example integration with external application through webhooks, see:

* [HTTP Webhook Strategy - Integration with Azure Service Bus](https://developer.emporix.io/ce/system-management/webhooks-user-guide/azure-service-bus-integration)
* [HTTP Webhook Strategy - Integration with Amazon Simple Queue Service (SQS)](https://developer.emporix.io/ce/system-management/webhooks-user-guide/amazon-sqs-integration)
  {% endhint %}
