LogoLogo
HomepageCase studiesBook a demo
Technical Guide
Technical Guide
  • Introduction
  • Getting Started Guide
    • Authentication
    • Member Registration Configuration
    • Add Webhook
    • Add Member
    • Create Campaign
    • Add Transaction
    • Add Custom Event Schema
    • Create Achievement
    • Add Custom Event
  • Terms Reference
  • Backward Compatibility Policy
  • API Reference
  • Postman Collection
  • User Guide
  • Integration
    • Introduction
    • Overview of Integration Methods
    • Tools and Technologies
    • Integration Examples
      • Lambda
      • Zapier
      • AWS EventBridge
      • Kafka
  • API Fundamentals
    • Overview
    • Environments Capabilities
    • How to Query
    • Limits
    • Best Practices
  • Authentication
    • Admin Token
    • Access Token (API Key)
    • Enabling SSO Login
      • Okta
      • Microsoft Entra ID
  • Webhooks
    • Overview
    • Best Practices
  • S3 Bucket Data exports
    • Overview
    • Set Up S3 Bucket Integration
    • Data Structure and Types
      • Achievements
      • Achievement Usage
      • Campaigns
      • Campaign Calculated Effect Result
      • Campaign Execution
      • Custom Events
      • Members
      • Rewards
      • Rewards Redemption
      • Tiers
      • Transactions
      • Tenants
      • Unit Transfers
Powered by GitBook
  1. Getting Started Guide

Add Webhook

See the sample example how webhooks can be configured. Links to more detailed instructions can be found at the end of the article.

Last updated 10 months ago

Was this helpful?

How this example works

Webhooks in Open Loyalty enable automated interactions by sending HTTP requests to specified URLs when certain events occur within the system. This feature allows for real-time notifications and integrations with external systems. For example, when a customer registers or a transaction is created, a webhook can notify a designated URL, triggering predefined actions such as updating records or sending notifications.

To receive webhooks for the following steps, we are going to set up two webhooks in this example.


Try yourself

  • Input the previous saved and in the request header

  • Retrieve a list of available webhook events Endpoint: GET /api/{storeCode}/webhook/event

  • Get the URL, where the webhooks are supposed to be sent to.

  • Add these three webhooks Endpoint: POST /api/{storeCode}/webhook/subscription

    {
      "webhookSubscription": {
        "eventName": "CustomerRegistered",
        "url": "string" // your specified URL
      }
    }

    {
      "webhookSubscription": {
        "eventName": "CustomerRegistered",
        "url": "string" // your specified URL
      }
    }

    {
      "webhookSubscription": {
        "eventName": "MemberAchievementProgressWasChanged",
        "url": "string" // your specified URL
      }
    }

Endpoints used


More resources

For a detailed overview and description of the webhooks, please refer to this article:

token
storeCode
WebhooksIn this section, you will learn about webhook integrations and notifications in Open Loyalty.

Get all webhook events.

get
Authorizations
Path parameters
storeCodestringRequired

Store code

Responses
200
List of webhook events
application/json
401Error
application/json
403
Forbidden.
application/json
get
GET /api/{storeCode}/webhook/event HTTP/1.1
Host: openloyalty.localhost
Authorization: YOUR_API_KEY
Accept: */*
{
  "items": [
    "text"
  ]
}

Create a new webhook subscription

post
Authorizations
Path parameters
storeCodestringRequired

Store code

Body
Responses
200
Return created webhook subscription ID.
application/json
400
Bad request.
application/json
401Error
application/json
403
Forbidden.
application/json
post
POST /api/{storeCode}/webhook/subscription HTTP/1.1
Host: openloyalty.localhost
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 112

{
  "webhookSubscription": {
    "eventName": "text",
    "url": "text",
    "headers": [
      {
        "headerName": "text",
        "headerValue": "text"
      }
    ]
  }
}
{
  "webhookSubscriptionId": "00000000-0000-0000-0000-000000000000"
}