Bonus Reward Points Without Inflation: A Simple Ledger Design for Loyalty Apps
Bonus reward points look easy on a whiteboard. Give the customer 2x points this weekend, 500 extra points on their birthday, a welcome bonus on the first purchase. Then finance asks a simple question: how much do we actu
Bonus reward points look easy on a whiteboard. Give the customer 2x points this weekend, 500 extra points on their birthday, a welcome bonus on the first purchase. Then finance asks a simple question: how much do we actually owe our customers right now? If your system stores points as a single number on the user row, nobody can answer that.
Here is a ledger based design that keeps bonus reward points honest, auditable and easy to expire.
Why a single balance column fails
A points_balance column hides history. You cannot tell which points came from a promotion, which are about to expire, or whether a bug credited the same bonus twice. When a customer disputes their balance, support has nothing to show them.
Use an append only ledger
CREATE TABLE points_ledger (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL,
entry_type TEXT NOT NULL, -- 'earn', 'bonus', 'redeem', 'expire', 'reversal'
points INT NOT NULL, -- positive for credit, negative for debit
campaign_id INT, -- which promotion created this bonus
source_ref TEXT, -- order id or QR code
expires_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT now(),
UNIQUE (entry_type, source_ref, campaign_id)
);
The balance is simply SUM(points) for a user. Cache it if you need speed, but the ledger is always the source of truth.
Separate base points from bonus points
Base points come from the purchase itself. Bonus points come from a campaign. Keep them as separate rows even when they are triggered by the same order:
- Row 1:
earn, 100 points, sourceORDER123 - Row 2:
bonus, 100 points, campaignWEEKEND2X, sourceORDER123
Now marketing can see exactly what each campaign cost, and if an order is refunded you can reverse both rows cleanly.
Give bonus points a shorter life
A healthy pattern is to let base points last 12 months and bonus points 30 to 90 days. Short expiry creates urgency, which is the whole point of a bonus. A nightly job finds unredeemed bonus rows past expires_at and writes a matching expire row. Redemptions should consume the oldest expiring points first (FIFO by expires_at).
Cap every campaign
Every bonus campaign needs a budget and a per user limit stored in the database, not in someone's memory. Before writing a bonus row, check:
SELECT COALESCE(SUM(points), 0)
FROM points_ledger
WHERE campaign_id = $1 AND entry_type = 'bonus';
If the next credit crosses the budget, skip it and log it. This one check has saved more loyalty programs than any fraud model.
Show the customer the breakdown
Customers trust points they can understand. In the app, show base points and bonus points separately, with the bonus expiry date in plain words: "150 bonus points expire on 15 January". This drives more redemptions and fewer support tickets.
Points or instant cashback?
Points work well for frequent purchases like coffee or fuel. For one time or low frequency purchases, many Indian brands now prefer instant cashback because the value is obvious. QR based platforms such as Assured Rewards let a customer scan a code on a genuine product and get cashback in a wallet straight away, which removes the "how much is a point worth" confusion entirely. If you are deciding between models, it is worth comparing how bonus reward points and instant wallet cashback perform for your category.
Summary
- Store points as an append only ledger, never a single balance
- Keep base and bonus points as separate rows
- Give bonus points a shorter expiry and redeem oldest first
- Put a budget and per user cap on every campaign
- Show customers exactly what they have and when it expires
Build it this way once and every future promotion becomes a safe configuration change.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.