Codes
The Codes module lets you upload unique codes into a pool and reward users when they submit one. Useful for on-pack promos, customer service gestures, and offline campaigns.
What is the Codes module?
The Codes module allows you to create and manage pools of unique codes that can be validated when users submit them through your program.
When a user submits a code:
The Loyalty Engine checks if the code exists in the pool and hasn’t been used.
If valid, a reactor is triggered (e.g., awarding points or issuing a voucher).
The code is marked as used and can’t be redeemed again.
Not the same as voucher code pools
Codes module (this article) – Used when you already have a pool of unique codes (e.g., printed on packaging, distributed by support teams). Users submit the code into your program, and it’s validated.
Voucher code pools – Codes given out by the Loyalty Engine when a user claims a reward, to be redeemed elsewhere (e.g., ecommerce checkout).
Example use cases
On-pack promotions
Print unique codes on product packaging (e.g., under caps or inside boxes, even on receipts). Users scan or enter them in your app or website to earn points or vouchers.
Customer service gestures
Provide one-off codes via your support team. When entered by the user, the code can trigger a reward such as bonus points.
Campaign rewards
Distribute unique codes via offline marketing (e.g., flyers, inserts at events). Users enter them to unlock loyalty rewards.
Key benefits
Control – Ensure codes can only be used once.
Flexibility – Use codes from any source (packaging, service, campaigns).
Integration – Codes work with existing events and reactors in the Loyalty Engine.
Using the Codes module
Create an event type
Create a custom event type that will be reported when users submit codes.
In the Loyalty Console, go to Events > Event Types > Create.
Example name:
SUBMITTED_CODE
. (Admins can choose something more relevant, e.g.,PURCHASED_PRODUCT
)Add a payload schema with a
code
property.Turn on the code pool enhancer for this event type. This ensures the Loyalty Engine validates submitted codes against your pools when an event of this type is reported.
{
"type": "object",
"$schema": "http://json-schema.org/draft-06/schema#"
"properties": {
"code": {
"type": "string",
"description": "The code submitted by the user"
}
},
"required": ["code"]
}

Create a reactor
Create a reactor that will run reactions when a code is submitted matching a code from your code pool.
Go to Events > Reactors > Create.
Choose the event type you created earlier (e.g.,
SUBMITTED_CODE
) as the trigger.Add a payload condition for and choose the relevant code pool the submitted code should be checked against.
Configure any reactions (e.g., award points, issue a voucher).

Test the flow
Report an event of your custom type with a valid code from the pool in the payload.
The reactor should trigger.
The code should be marked as used in the pool.
Try submitting the same code again.
The reactor won’t trigger because the code is already used.
Try a code not in the pool.
The reactor won’t trigger.

Additional notes
You can create multiple code pools (e.g., one per product SKU).
Reactors can be linked to different pools to run different reactions (e.g., 100 points for SKU A, 200 points for SKU B, bonus voucher for SKU C etc.).
You can edit a code pool at anytime after creating it by opening it in the Loyalty Console and pressing 'Edit' in the top right corner. You can:
Mark a code pool as 'inactive' to prevent any reactors validating against it to not run.
Top up the code pool with more codes if the pool runs low.
Remove codes from the code pool to prevent them being validated by a reactor.
Last updated
Was this helpful?