How to Configure a Webhook

Create and manage webhook subscriptions in the Admin Panel or via API.

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.

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.


Add a webhook in the Admin Panel

1

Open the creation form

Go to Webhooks and click Add new webhook.

2

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.

3

Save the webhook

Click Add webhook to save the subscription. When the event occurs, Open Loyalty sends the payload to the configured address.


Create a subscription via API

You can manage subscriptions through the API endpoint:

Get all webhook subscriptions.

get

If sorting is not chosen, the rows will be returned in an unspecified order.
To sort a result, use an _orderBy parameter in query.

Authorizations
AuthorizationstringRequired

Open Loyalty has the JWT authorization. To learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens https://jwt.io/introduction/

Obtain an access token

Send a request with the parameters username and password

Definition

POST /api/admin/login_check Go to definition
POST /api/{storeCode}/member/login_check Go to definition

Example

curl {HOST}/api/admin/login_check
    -H 'Content-Type: application/json;charset=UTF-8'
    -H 'Accept: application/json, text/plain, */*'
    --data-binary '{"username":"admin","password":"password"}'

Example Response

{
    "token":"eyJhbGciOiJSUzI1NiIsInR5cCI6...",
    "refresh_token":"0558f8bb29948c4e54c443f..."
}

Using JSON Web Token

Add authorization header to each request
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...
You can now access any API method you want under the /api prefix.

Example

curl {HOST}/api/{storeCode}/analytics/members
    -H 'Accept: application/json'
    -H 'Content-type: application/x-www-form-urlencoded'
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'

Refresh JSON Web Token

You can refresh token using refresh_token that was given during login.
There are two endpoints
To refresh admin token POST /api/token/refresh Go to definition
To refresh member token POST /api/{storeCode}/token/refresh Go to definition

Path parameters
storeCodestringRequired

Store code

Query parameters
urlstringOptional
legacybooleanOptional
eventNamestringOptional
createdAtstring · date-timeOptional
_pageintegerOptional
_itemsOnPageintegerOptional
_orderBystringOptional
Responses
chevron-right
200

List of webhook subscriptions

application/json
get
/api/{storeCode}/webhook/subscription

Create a new webhook subscription

post
Authorizations
AuthorizationstringRequired

Open Loyalty has the JWT authorization. To learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens https://jwt.io/introduction/

Obtain an access token

Send a request with the parameters username and password

Definition

POST /api/admin/login_check Go to definition
POST /api/{storeCode}/member/login_check Go to definition

Example

curl {HOST}/api/admin/login_check
    -H 'Content-Type: application/json;charset=UTF-8'
    -H 'Accept: application/json, text/plain, */*'
    --data-binary '{"username":"admin","password":"password"}'

Example Response

{
    "token":"eyJhbGciOiJSUzI1NiIsInR5cCI6...",
    "refresh_token":"0558f8bb29948c4e54c443f..."
}

Using JSON Web Token

Add authorization header to each request
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...
You can now access any API method you want under the /api prefix.

Example

curl {HOST}/api/{storeCode}/analytics/members
    -H 'Accept: application/json'
    -H 'Content-type: application/x-www-form-urlencoded'
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'

Refresh JSON Web Token

You can refresh token using refresh_token that was given during login.
There are two endpoints
To refresh admin token POST /api/token/refresh Go to definition
To refresh member token POST /api/{storeCode}/token/refresh Go to definition

Path parameters
storeCodestringRequired

Store code

Body
Responses
chevron-right
200

Return created webhook subscription ID.

application/json
webhookSubscriptionIdstring · uuidOptionalExample: 00000000-0000-0000-0000-000000000000
post
/api/{storeCode}/webhook/subscription

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


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.

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

Last updated

Was this helpful?