Open Loyalty to Braze

Syncing Open Loyalty Webhooks to Braze

Inbound webhooks: Open Loyalty → Braze

Send Open Loyalty webhook events to Braze. Use a Braze Data Transformation to convert the payload into a Braze API call.

This works for any Open Loyalty event. Examples: points changes, tier changes, campaign effects, reward redemptions.

Pick your delivery model in Braze

  • Custom event-based campaigns Best when you want Braze to record an event. You trigger Action-Based campaigns via Perform Custom Event.

  • API-triggered campaigns Best when one Open Loyalty event should send one specific campaign. Braze does not need to store a custom event. The transformation calls Braze “Send Campaigns via API-Triggered Delivery”.

circle-info

In both models, you must map one stable user identifier. Most setups use loyaltyCardNumber as Braze external_id / external_user_id, but it solely depends on how you implented identifiers in Open Loyalty.


Custom event-based campaigns

1

Create the Braze Data Transformation

  1. In Braze, go to Data Settings > Data Transformation.

  2. Click Create transformation.

  3. Set Transformation name (example: Open Loyalty Webhooks → Custom Events).

  4. Set Select destination to POST: Track users.

  5. Click Create Transformation.

  6. Copy the Webhook URL.

circle-exclamation
2

Create the Open Loyalty webhook subscription

  1. In Open Loyalty Admin Panel, go to General > Webhooks.

  2. Click Add new webhook.

  3. Configure:

    • Event Name: Pick the Open Loyalty event you want to forward. Example: AvailablePointsAmountChanged, CustomerLevelChanged, CampaignEffectWasApplied.

    • URL: Paste the Braze webhook URL.

    • Headers:

      • Content-Type: application/json

      • User-Agent: partner-OpenLoyalty

  4. Save.

3

Map Open Loyalty → Braze custom event (users/track)

  1. In Braze, open your transformation.

  2. Trigger the Open Loyalty event once to capture a sample payload.

  3. In Transformation code, map the payload to a Braze event.

// Open Loyalty webhook body is available as `payload`
const data = payload.data;

return {
  events: [
    {
      // Must match a user identifier in Braze
      external_id: data.customer.loyaltyCardNumber,

      // This is the custom event name visible in Braze
      name: "Loyalty Event Triggered",
      time: new Date().toISOString(),

      // These become `event_properties` in Braze
      properties: {
        event_type: payload.type,
        event_time: payload.createdAt,

        // Example fields (adjust per event type)
        new_balance: data.amount,
        change_amount: data.amountChange
      }
    }
  ]
};
  1. Click Validate.

  2. Click Activate.

4

Create an Action-Based campaign triggered by the custom event

  1. Create a campaign (Email, Push, SMS).

  2. Under Schedule Delivery, pick Action-Based.

  3. Add trigger Perform Custom Event.

  4. Select the event name from the transformation. Example: Loyalty Event Triggered.

  5. Use Liquid to access event properties:

    • {{event_properties.${new_balance}}}

    • {{event_properties.${change_amount}}}


Create API-triggered Campaigns

1

Create the Braze campaign (API-triggered) and copy Campaign ID

  1. Create a campaign (Email, Push, SMS).

  2. Under Schedule Delivery, pick API-Triggered.

  3. In API Trigger Options, copy the Campaign ID.

2

Create the Braze Data Transformation (webhook URL)

  1. In Braze, go to Data Settings > Data Transformation.

  2. Click Create transformation.

  3. Set Transformation name (example: Open Loyalty Webhooks → API Trigger).

  4. Set Select destination to POST: Send Campaigns via API-Triggered Delivery.

  5. Click Create Transformation.

  6. Copy the Webhook URL.

3

Create the Open Loyalty webhook subscription

  1. In Open Loyalty Admin Panel, go to General > Webhooks.

  2. Click Add new webhook.

  3. Configure:

    • Event Name: Pick the Open Loyalty event you want to forward.

    • URL: Paste the Braze webhook URL.

    • Headers:

      • Content-Type: application/json

      • User-Agent: partner-OpenLoyalty

  4. Save.

4

Map Open Loyalty → Braze API-triggered send

  1. In Braze, open your transformation.

  2. Trigger the Open Loyalty event once to capture a sample payload.

  3. In Transformation code, build the API-trigger request.

const data = payload.data;

return {
  // Paste your Braze Campaign ID here
  campaign_id: "YOUR_CAMPAIGN_ID",
  recipients: [
    {
      // Must match a user identifier in Braze
      external_user_id: data.customer.customerId || data.customer.loyaltyCardNumber,

      // Available in messages as `api_trigger_properties`
      trigger_properties: {
        event_type: payload.type,
        event_time: payload.createdAt,

        // Example fields (adjust per event type)
        new_balance: data.amount,
        change_amount: data.amountChange
      },

      // Optional: update profile attributes before sending the campaign
      attributes: {
        loyalty_card_number: data.customer.loyaltyCardNumber
      },

      // Keep `true` if you only want to message users who already exist in Braze
      send_to_existing_only: true
    }
  ]
};
  1. Click Validate.

  2. Click Activate.

5

Personalize the message with API trigger properties

In your campaign message, reference properties via Liquid:

  • {{api_trigger_properties.${new_balance}}}

  • {{api_trigger_properties.${change_amount}}}

Last updated

Was this helpful?