# How to Configure a Webhook

## Overview

Open Loyalty uses a subscription model for webhooks. You receive only the events that you enable.

You can create a subscription in two ways:

* In the Admin Panel
* Via API

To create a webhook, you typically define:

* The event to subscribe to
* The destination URL
* Optional request headers

***

### Open the webhook list

Go to **Webhooks** in the Admin Panel.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FM6cWCirzAvpgtjhHC5av%2Fimage.png?alt=media&#x26;token=fae8af5f-23a1-4615-9c91-b4c92d660d68" alt=""><figcaption></figcaption></figure>

This view shows all configured subscriptions. Typical fields include:

* **Webhook name** – Internal name of the subscription
* **Active from** – Date when the webhook becomes active
* **Legacy** – Whether the webhook uses legacy mode
* **URL** – Destination address for delivery

Use filters or the search box to find a specific subscription faster.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FfcaEffOlTE8WCiboExNb%2Fimage.png?alt=media&#x26;token=69373b57-fe63-4c24-ba9d-b5550ba3bd03" alt=""><figcaption></figcaption></figure>

***

### Add a webhook in the Admin Panel

{% stepper %}
{% step %}

### Open the creation form

Go to **Webhooks** and click **Add new webhook**.
{% endstep %}

{% step %}

### Fill in the subscription details

Choose the event you want to subscribe to. Enter the destination URL for delivery.

You can also add custom headers. Headers are optional.
{% endstep %}

{% step %}

### Save the webhook

Click **Add webhook** to save the subscription. When the event occurs, Open Loyalty sends the payload to the configured address.
{% endstep %}
{% endstepper %}

***

### Create a subscription via API

You can manage subscriptions through the API endpoint:

```
/api/{storeCode}/webhook/subscription
```

{% openapi src="<https://content.gitbook.com/content/cNVX03KZzmrGwJihLiEx/blobs/E3jY9ZVxWGaOI6NtTIJS/openapi-5.34.0.json>" path="/api/{storeCode}/webhook/subscription" method="get" expanded="false" %}
[openapi-5.34.0.json](https://content.gitbook.com/content/cNVX03KZzmrGwJihLiEx/blobs/E3jY9ZVxWGaOI6NtTIJS/openapi-5.34.0.json)
{% endopenapi %}

{% openapi src="<https://content.gitbook.com/content/cNVX03KZzmrGwJihLiEx/blobs/E3jY9ZVxWGaOI6NtTIJS/openapi-5.34.0.json>" path="/api/{storeCode}/webhook/subscription" method="post" %}
[openapi-5.34.0.json](https://content.gitbook.com/content/cNVX03KZzmrGwJihLiEx/blobs/E3jY9ZVxWGaOI6NtTIJS/openapi-5.34.0.json)
{% endopenapi %}

Set the webhook name in `eventName`. Set the destination address in `url`. Add headers if your integration requires them.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2Fj8JMHtwOJ8NqCbkBwOsn%2Fimage.png?alt=media&#x26;token=2d498b35-8c6a-4b21-873a-8b317450a7ae" alt=""><figcaption></figcaption></figure>

***

### Example payload

The `account.available_points_amount_changed` webhook is sent when a member’s available units change. The payload contains event metadata and a `data` object with the affected entities.

```json
{
"eventName": "string",
"storeCode": "string",
"createdAt": "2019-08-24T14:15:22Z",
"data": {
  "customer": {},
  "accountId": "string",
  "amount": null,
  "amountChange": null,
  "amountChangeType": "string",
  "wallet": {}
}
}
```

Use webhook payloads to trigger downstream actions in your own systems. Typical examples include CRM updates, transactional messaging, and workflow automation.

<figure><img src="https://content.gitbook.com/content/cNVX03KZzmrGwJihLiEx/blobs/kf9EJ6LdzNhQXwcjKHOI/image.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.openloyalty.io/main-features/webhooks/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
