Webhooks
In this section, you will learn about webhook integrations and notifications in Open Loyalty.
Webhooks is a mechanism allowing us to send HTTP requests to the URL configured by Admin, triggered by an Event, such as customer registration, transaction creation, customer data edit, etc.
The new webhook mechanism is based on subscriptions to individual events occurring in the system. The following webhooks are accessible using the subscription method:
- TransactionRegistered
- PointsWillExpire
- LevelWillExpire
- AvailablePointsAmountChanged
- TransactionAssignedToCustomer
- RewardRedemptionStatusChanged
- CustomerWasRegisteredWithoutActivation
- CustomerUpdated
- CustomerRequestedSendActivationCode
- CustomerRequestedPasswordReset
- CustomerRegistered
- CustomerPhoneNumberWasChanged
- CustomerLevelChanged
- CustomerEmailWasChanged
- CustomerDeactivated
- CustomerBoughtReward
- CouponWillExpire
To enable gradual migration to the new mechanism, we have prepared a legacy mode, thanks to which the data sent in webhooks are in the same format as in the earlier version of the system.
The subscription method means that you can decide which webhooks are active - you do not receive data from the ones you are not interested in.
You can subscribe to the webhook in two ways.
One way is to use the admin panel, which will allow you to configure webhooks using a graphical interface, and the second is to use the endpoint.
To get to webhooks in the admin panel head to Settings and then to Webhooks

- Webhook name - Webhook name in the system
- Active from - Date of webhook activation
- Legacy - Information is webhook is working in the Legacy mode
- URL - Address to which the webhook is sent
To make it easier to search for a specific webhook, you can use filtering based on the headers.
To add a new webhook subscription, log in to the app as an Administrator, go to Webhooks and open the webhook configuration menu by clicking the Add New Webhook button.

From the dropdown list choose the webhook you'd like to subscribe to. Enter the address to which the webhooks will be sent.
In addition, you can add a header to the webhook however, it is not required by the system.
After saving, when the correct event is executed, the webhook will be sent to the previously entered address.
You can also subscribe to the webhook by using the endpoint:
/api/{storeCode}/webhook/subscription
In the body request, put the name of the webhook in eventName and the address of the service you want the data to be sent to in the URL
Webhook 'account.available_points_amount_changed' automatically informs whenever the number of available points in a user's account changes. The update information is presented in the form of a body containing the following information.
{
"eventName": "string",
"storeCode": "string",
"createdAt": "2019-08-24T14:15:22Z",
"data": {
"customer": {},
"accountId": "string",
"amount": null,
"amountChange": null,
"amountChangeType": "string",
"wallet": {}
}
Webhook can be used as a trigger to execute an action on the user side of the application.

Last modified 10d ago