Reporting events to deduct points
Overview
You can report a custom event that directly deducts points from the user’s wallet, for example an event like REDEEMED_POINTS. This gives you the highest amount of flexibility in terms of handling who/what provides real-world value to the customers.
This follows the normal Reporting events flow.
Implementation steps
API References
Create a custom event type
Create an event type such as REDEEMED_POINTS, and include a payload schema with a property called points (or any other property which represents a value related to the points adjustment, like a currency amount).
Create a reactor
Create a reactor triggered by the REDEEMED_POINTS event, and configure it with an Adjust Points reaction. This reaction should adjust the user’s points balance by the value of the points property multiplied by 1.
Report the event
Use the API to report the REDEEMED_POINTS event before giving the real world value to the user, specifying the number of points to adjust in the points property of the event payload.
{
"type": "REDEEMED_POINTS",
"payload": {"amount": 500, "venue": "XYZ"},
"subject": "9cb2cc08-e033-4200-86a7-95a03ba09462",
"occurredAt": "2024-06-08T08:57:47.198Z"
}Last updated
Was this helpful?