Segment Updates
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
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
Prepare Open Loyalty
Before sending data, ensure Open Loyalty is ready to utilize the incoming label.
Decide on the Label Key you will use (e.g.,
braze_vip_segmentorbraze_optedIn).In Open Loyalty, create a Segment that filters members based on this label. * Condition: Member has custom attribute value
braze_vip_segmentequal tooptedIn.
Create Braze Webhook Campaign
We will configure Braze to send the API request whenever a user qualifies for the segment.
In Braze, create a new Webhook Campaign (or use a Webhook within a Canvas).
Click on Compose Webhook
Webhook URL: Construct the URL using your Open Loyalty instance, Tenant ID, and the Braze Liquid variable for the user ID.
Format:
https://<YOUR_OL_INSTANCE>/api/<TENANT_ID>/member/loyaltyCardNumber={{${user_id}}}Request Method:
PATCHRequest Headers:
Content-Type:application/jsonX-AUTH-TOKEN:<YOUR_PERMANENT_TOKEN>User-Agent: Braze
Request Body: Select
Raw textand paste the payload. You can customize thekeyandvalueto match your segment strategy.
{
"customer": {
"labels": [
{
"key": "braze_vip_segment",
"value": "optedIn"
}
]
}
}Testing the Setup
Trigger the Sync:
Identify a test user in Braze who is not currently in the target segment (e.g., "VIP Users").
Manually perform the action that qualifies them for the segment.
Example: If the segment logic is "Custom Attribute
spend_amount > 500", go to the user's profile in Braze and manually edit theirspend_amountto501.
This forces the user to enter the segment, triggering the webhook campaign.
Verify in Braze:
Go to Settings > Message Activity Log.
Look for the recent webhook event for your campaign.
Confirm the status is
200 OK. If it failed, check the log for error messages (e.g., 401 Unauthorized often means an invalid API token).
Verify in Open Loyalty:
Log in to the Open Loyalty Admin Panel.
Navigate to Members > All Members and search for the test user by their
loyaltyCardNumber.Open their profile and check the Labels (or Custom Attributes) section.
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?

