Open Loyalty to Braze
Syncing Open Loyalty Webhooks to Braze
Inbound webhooks: Open Loyalty → Braze
Pick your delivery model in Braze
Custom event-based campaigns
3
Map Open Loyalty → Braze custom event (users/track)
// 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
}
}
]
};Create API-triggered Campaigns
4
Map Open Loyalty → Braze API-triggered send
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
}
]
};Last updated
Was this helpful?

