Open Loyalty to Braze

Syncing Open Loyalty Webhooks to Braze

Inbound Webhooks: Syncing Events to Braze

This guide explains how to integrate any Open Loyalty webhook event with Braze. Whether you want to track point changes, tier upgrades, or reward redemptions, the process is the same: you will send data from Open Loyalty to Braze, where a Data Transformation converts it into a User Event.

Integration Architecture

Because the JSON schema of Open Loyalty webhooks does not perfectly match Braze's API requirements, we cannot send data directly to the Braze users/track endpoint. Instead, we use Braze's Data Transformation feature to act as a "translator" between the two systems.


Setting up the integration

1

Generate the Webhook URL

First, create a Data Transformation in Braze to generate a unique URL for receiving data.

  1. In Braze, open Data Settings > Data Transformation.

  2. Click Create transformation.

  3. Transformation name: Give it a descriptive name (e.g., "Open Loyalty Point Update Events").

  4. Select destination: Choose POST: Track users.

  5. Click Create Transformation.

  6. Locate the Webhook URL on the right side and click Copy.

2

Create the Webhook Subscription

Tell Open Loyalty to send specific events to the URL you just generated.

  1. Log in to your Open Loyalty Admin Panel.

  2. Navigate to General > Webhooks.

  3. Click Add new webhook and configure the subscription:

    1. eventName: Select the event you want to track (e.g., AvailablePointsAmountChanged, CustomerLevelChanged, or CampaignEffectWasApplied).

    2. url: Paste the Braze Webhook URL from Step 1.

    3. Add the following headers:

      1. Content-Type: application/json

      2. User-Agent: partner-OpenLoyalty

  4. Save the webhook subscription.

3

Configure the Data Transformation

Now you must write the JavaScript logic in Braze to map the incoming Open Loyalty payload to Braze properties.

  • In Braze, open the data transformation you created in Step 1.

  • Trigger the event in Open Loyalty (e.g., change a member's points or assign a tier) to generate a sample payload in the Webhook details pane.

  • In the Transformation code editor, write a script to map the incoming data.

Generic Mapping Example: The following code demonstrates how to map an incoming event to a Braze Custom Event.

// 1. Parse the incoming Open Loyalty payload
const data = payload.data;

// 2. Construct the Braze API body
let brazecall = {
  "events": [
    {
      // CRITICAL: Map the identifier (e.g., loyaltyCardNumber -> external_id)
      "external_id": data.customer.loyaltyCardNumber,
      
      // Define the Event Name (what you will see in Braze)
      "name": "Loyalty Event Triggered",
      
      // timestamp
      "time": new Date().toISOString(),
      
      // Map specific properties you want to use in emails/segments
      "properties": {
        "event_type": payload.type, // e.g., 'AvailablePointsAmountChanged'
        "new_balance": data.amount,
        "change_amount": data.amountChange,
        "tier_name": data.tier ? data.tier.name : null
      }
    }
  ]
};

return brazecall;
  • Click Validate to ensure the code runs against your sample payload.

  • Click Activate.

4

Trigger Campaigns in Braze

Once the Data Transformation is active, the data will appear in Braze as a Custom Event. You can now use this to trigger campaigns.

  1. Create a new Campaign (Email, Push, or SMS) in Braze.

  2. Under Delivery Method, select Action-Based.

  3. For the Trigger, select Perform Custom Event.

  4. Choose the event name you defined in your JavaScript (e.g., Loyalty Event Triggered).

  5. Personalization: You can now use Liquid to reference the properties you mapped:

    • {{event_properties.${new_balance}}}

    • {{event_properties.${tier_name}}}

  6. Ensure your Target Audience includes the users you are testing with.

  7. Click Launch Campaign.

Last updated

Was this helpful?