Braze to Open Loyalty

Updating Open Loyalty Member Attributes from Braze

Outbound Updates: Modifying Open Loyalty Members

This guide explains how to automatically update member data in Open Loyalty based on user behavior in Braze. We achieve this by using Braze Webhooks to send API requests to Open Loyalty's Member API.

This is commonly used to:

  • Add Labels to a member in Open Loyalty (e.g., "VIP", "Churn Risk").

  • Update custom attributes based on Braze engagement.

  • Sync segmentation status between platforms.

Prerequisites

Prerequisite
Description

API Token

A permanent Open Loyalty token (X-AUTH-TOKEN) with permission to modify members.

Tenant Code

Your Open Loyalty Tenant Code.

Matching IDs

The user's external_id in Braze must match their loyaltyCardNumber (or another default identifier - email, phone, member ID) in Open Loyalty.


Integration Overview

This integration uses Braze Webhooks to send data to Open Loyalty. When a user enters a specific segment in Braze, we trigger a webhook that sends a PATCH request to the Open Loyalty Member API. This updates the member's Labels (custom attributes), which can then be used to define segments within Open Loyalty.

Prerequisites

Prerequisite
Description

Open Loyalty API Token

A permanent token (X-AUTH-TOKEN) with permission to modify members.

Tenant ID

Your Open Loyalty Tenant ID (e.g., KHO).

Matching IDs

The user's external_id in Braze must match their loyaltyCardNumber in Open Loyalty.


Setting up the integration

1

Define the Update Logic

Decide what triggers the update and what data you want to change. In this guide, we will add a Label (Custom Attribute) to a member profile.

  • Trigger: A user enters a specific Segment in Braze (e.g., "High Spenders").

  • Action: Add the label braze_vip to their Open Loyalty profile.

2

Configure Braze Webhook Campaign

You can trigger this update via a Webhook Campaign or a Webhook component within a Braze Canvas.

  1. In Braze, create a new Webhook Campaign (or use a Webhook within a Canvas).

  2. Click on Compose Webhook

  3. Webhook URL: Construct the URL using your Open Loyalty instance, Tenant ID, and the Braze Liquid variable for the user ID.

    1. Format: Sample format https://<YOUR_OL_INSTANCE>/api/<TENANT_ID>/member/loyaltyCardNumber={{${user_id}}}

    2. Request Method: PATCH

    3. Request Headers:

      • Content-Type: application/json

      • X-AUTH-TOKEN: <YOUR_PERMANENT_TOKEN>

      • User-Agent: Braze

    4. Request Body: Select Raw text and paste the payload. You can customize the key and value to match your segment strategy.

3

Configure the Trigger

  1. Navigate to the Delivery or Entry Schedule tab.

  2. Delivery Method: Action-Based.

  3. Trigger: Define Relevant Trigger

  4. Launch: Activate the campaign.

4

Testing the Setup

  1. Trigger the Webhook: Manually add a test user to the target Braze segment or click "Send Test" in the webhook composer (you will need to supply a valid user ID).

  2. Verify in Braze: Check the Message Activity Log to ensure the webhook returned a 200 OK status.

    • 401 Error: Checks your API Token.

    • 404 Error: The user ID found in Braze does not exist in Open Loyalty.

  3. Verify in Open Loyalty:

    • Log in to the Open Loyalty Admin Panel.

    • Navigate to Members > All Members and search for the test user.

    • Check the Labels or Custom Attributes section to confirm the new key-value pair exists.

    • Success: You should see the new label (e.g., braze_brazeSegmentId: "optedIn").

    • Optional: If you created a Segment in Open Loyalty based on this label, confirm the user now appears in that segment.

Last updated

Was this helpful?