Custom Events
Rewarding what members do outside a purchase — reading content, entering codes, registering devices, opting in — with custom events, safely and only once.
A custom event is anything a member does that isn't a purchase: reading an article, answering a survey, entering a code from a pack, registering a device, subscribing to a newsletter, connecting a social account. Your systems send the event; campaigns and challenges in Open Loyalty decide what it's worth.
For purchases and returns, use transactions. For the Admin Panel side, see Custom events, Custom event schemas and the custom event campaign trigger.
Who does what
Admin Panel
One schema per event type with the attributes rules need; custom event campaigns, challenges and, for codes, redemption code campaigns
Integration layer
Sends one event per member action with a deterministic eventId; treats a duplicate as already processed
Website / app
Reports the action; validates codes in real time if your system owns them
CRM / marketing automation
Receives campaign effects and balance changes through webhooks
Design decisions
Event types
One generic type with a kind attribute, or one type per action
One type per action (article_read, device_registration, newsletter_opt_in). Campaigns, challenges and reports stay readable.
Attributes
Only an ID, or everything a rule might use
Send what rules filter on (category, brand, product, channel). An attribute that isn't in the event can't be used later.
eventId
Random, or derived from the action
Derived, so the same action always has the same ID — see below.
Who validates codes
Your system, or an Open Loyalty redemption code campaign
Your system if codes already live there or the member must see "used" or "invalid" immediately. Open Loyalty if you want it to generate or hold the code pool.
One reward per action, or limits
Per event, or capped per member and period
Use campaign limits for caps (e.g. one reward per article, five codes per month).
Recommended flow
Make it idempotent
eventId is optional in the API but unique per tenant when sent. Build it from the action itself, so a retry or a repeated click produces the same ID:
Action
eventId
Article read
{customer ID}_ARTICLE_{article key}
Newsletter opt-in
{customer ID}_NEWSLETTER_{list}
Device registration
DEVREG_{device serial}
Code entry
the code, or your system's scan ID
A second event with the same eventId is rejected with 400 "Custom Event with such event id already exists" — treat it as already processed, not as a failure.
Tell the member
Subscribe to CampaignEffectWasApplied and WalletBalanceUpdated to message the member or update CRM. If an event awards a fortune wheel spin instead of points, it still has to be drawn — see fortune wheels.
Sequence diagrams


Go-live checklist
Admin Panel
Integration layer
Website / app
Validation
Key endpoints
POST /api/{storeCode}/customEvent— Add a custom eventGET /api/{storeCode}/customEvent— Get custom events list, filtered e.g. bycustomerData:loyaltyCardNumber
Webhooks: CampaignEffectWasApplied, WalletBalanceUpdated
Last updated
Was this helpful?

