The Problem
A consumer electronics retailer had strong customer acquisition numbers and weak retention. Customers were buying once and not returning — a pattern common in electronics retail where purchase cycles are long and category loyalty is low. The team identified a cashback program as the mechanism to change that behavior: give customers a financial incentive to return, tied to their purchase history.
The idea was straightforward. The implementation was not. A cashback program without the right infrastructure becomes a financial liability. Cashback that can be gamed, double-spent, or incorrectly calculated erodes margin instead of building retention. Cashback that can’t be redeemed seamlessly at checkout creates friction that cancels out the loyalty benefit.
The Constraints
Fraud prevention from day one. A cashback wallet is an asset that can be exploited. The system had to prevent balance manipulation, duplicate spending across devices, and campaign abuse (e.g., purchasing and returning to accumulate cashback without a real transaction) from the initial launch — not as a Phase 2 addition.
Flexible calculation logic. Cashback rates vary by product category, campaign, user segment, and promotional period. Hard-coding rules would require engineering intervention for every campaign change. The calculation engine had to be rules-driven and configurable by non-technical staff.
Seamless checkout integration. A cashback balance that users have to navigate away from the checkout flow to redeem creates abandonment. The redemption UI had to be embedded directly in the existing checkout experience with partial and full redemption options.
Our Approach
The cashback system is built on three core components: the calculation engine, the user wallet, and the redemption integration.
The calculation engine implements flexible rules that operate across multiple dimensions simultaneously: product category rates, campaign-specific overrides, user segment multipliers, and time-bounded promotional rules. Business staff configure rules through an admin interface; the engine evaluates the applicable rule set at transaction time without engineering intervention.
The user wallet stores cashback balances in PostgreSQL with Redis caching for fast read performance at checkout. All balance updates are written with optimistic locking to prevent race conditions on concurrent redemptions. Transaction history is stored immutably — every credit and debit has an associated transaction record that appears in the user’s history.
The fraud protection layer operates at the wallet write level: balance verification before every debit, device fingerprinting to detect multi-device abuse, and return policy enforcement that freezes cashback associated with returned transactions until the return window closes.
The checkout integration adds a cashback redemption step to the existing React Native checkout flow — surfacing the available balance, calculating the post-cashback total, and handling partial redemption when cashback exceeds a configurable minimum purchase threshold.

The Outcome
- +25% increase in repeat purchase rate within 90 days of cashback program launch
- +18% increase in average order value — customers increasing basket size to reach cashback thresholds
- Real-time balance visibility and full transaction history available to every user through the mobile app
- Zero double-spending incidents since launch — fraud protection architecture functioning as designed
Team
Engagement: 4 months, 3 engineers (1 backend, 1 mobile, 1 QA).
Stack: Node.js, React Native, PostgreSQL, Redis, REST APIs, Stripe, AWS