Skip to content
Web Development9 min read

Ecommerce Loyalty Program Development: How to Build a Customer Rewards System

Building an ecommerce loyalty program: rules engine, points ledger, tiers, redemption, returns, POS and app integration, fraud controls, privacy, build vs buy.

01

Quick answer

A loyalty program is built from five parts: event intake (orders, returns, reviews, sign-ups, store purchases), a rules engine that turns events into points and tier progress, an append-only points ledger from which balances are derived, redemption flows at checkout and POS, and channel integrations for the account page, emails and apps. Keep points pending until return windows close, reverse points on refunds, calculate tiers on schedule, protect redemptions from abuse and give finance the data to account for outstanding points.

02

Where This Fits

What to reward and how to model the economics is covered in ecommerce loyalty programs. How members see and use the program is in loyalty program UX. Referral rewards have their own mechanics, covered in referral program development, and the wider stack is in customer retention technology.

03

Loyalty Architecture

The loyalty service should not live inside the storefront theme. It receives events from the commerce platform, POS and other sources, applies rules, writes to the ledger and exposes balances and rewards to every channel through an API.

ComponentResponsibilityDesign note
Event intakeReceive orders, refunds, reviews, sign-ups, POS salesIdempotent by source event ID
Member profileIdentity, enrolment, consent, tierLinked to customer IDs in commerce and POS
Rules engineEarning, bonuses, tier qualification, eligibilityVersioned rules, effective dates
Points ledgerEvery points change with its reasonAppend-only; balances derived
Rewards catalogDiscounts, products, experiencesStock and cost controls
RedemptionReserve, apply, confirm, releaseSame logic online and in store
Channel APIsBalances and rewards for site, app, email, POSCached reads, authoritative writes
04

Earning Rules

Rules convert events into points: base earn rate per unit spent, category multipliers, bonus campaigns with dates, actions such as reviews or profile completion, and exclusions (gift cards, taxes, shipping). Version rules with effective dates so you can explain why an order earned what it did. Earn on the amount actually paid, after discounts, and decide whether points earned with a discount should be lower.

05

The Points Ledger

The ledger is the heart of the system. Every change is an entry: points pending from an order, made available when the return window closes, redeemed, released after a cancelled redemption, reversed after a refund, expired or manually adjusted with a reason. The balance is the sum of entries, never a number someone can edit directly. This makes support, audits and finance reporting possible.

Example: points ledger entries for one order (illustrative)
entry  type        points  ref               note
1      pending       +120  order 50213       earned on $120 paid
2      available     +120  order 50213       return window closed
       pending       -120  order 50213       (moved from pending)
3      redeemed      -100  order 50877       $5 off at checkout
4      reversed       -20  refund 50213-1    partial return of $20

available balance = sum(available) + sum(redeemed) + sum(reversed) = 0
06

Tiers

Tiers are calculated from qualifying activity such as spend or orders in a rolling or calendar year. Decide when to recalculate (after each order for upgrades, on a schedule for downgrades), how long a grace period lasts after falling below a threshold and what each tier unlocks. Store tier history so you can answer 'why did I lose Gold?' with dates and amounts.

07

Redemption at Checkout and in Store

Redemption must behave like payment: reserve points when the customer applies them, confirm the deduction when the order is placed, and release them if checkout is abandoned or the order is cancelled. Apply rewards as discounts the platform understands, so tax and refunds calculate correctly. In store, POS needs the same API, identification by phone, email or app, and handling for offline periods.

Building loyalty that works online, in app and in store?

ZSpace Labs can design the ledger, rules and redemption flows and integrate them with your commerce platform, POS and customer apps.

Start a Project
08

Expiry

Expiry rules (points expire after a period, or after a period of inactivity) need scheduled jobs that write expiry entries, reminders before expiry, and clear terms. Some jurisdictions regulate expiry and changes to loyalty terms, so check with legal advisers before launch and before changing rules.

09

Returns, Cancellations and Adjustments

Refunds must reverse the points earned on refunded amounts, and cancelled orders that used points must restore them. If points were already spent, decide whether the balance can go negative or the reversal is capped. Manual adjustments by support should require a reason and, above a threshold, approval.

10

Fraud and Abuse Controls

  • Points pending until the return window closes
  • Caps on points from non-purchase actions
  • Duplicate account detection by email, phone, device and address
  • Verification before large redemptions or reward transfers
  • Alerts on unusual earning or redemption patterns
  • Staff adjustment limits and audit logs
11

Finance and Reporting

Outstanding points have a value. Finance teams often need reports of points issued, redeemed, expired and outstanding, and an estimate of how many will never be redeemed (breakage). Under revenue standards such as IFRS 15 and ASC 606, part of the revenue from a sale that earns points may need to be deferred. Provide the ledger data and let your accountants decide the treatment.

12

Build vs Buy

OptionFitsTrade-offs
Loyalty app on your platformMost D2C brandsFast; limited custom rules and POS depth
Loyalty platform with APIsMulti-channel retailers, appsFlexible; integration work and fees
Custom buildUnusual programs, multi-brand, loyalty as productFull control; long-term maintenance
13

Rewards Catalog and Benefit Types

Points are only as motivating as what they buy. Model rewards as a catalog with types, costs and rules: fixed discounts, percentage discounts, free products, free shipping, early access, experiences and tier benefits that are not bought with points at all. Each reward needs eligibility (tier, market, channel), limits (per customer, per period, stock for physical rewards) and a cost owner for reporting.

Benefit typeHow it is deliveredWatch out for
Points-for-discountDiscount code or checkout rewardStacking with other promotions
Free productZero-price line itemStock and tax treatment
Free shipping or returnsTier benefit at checkoutCost in remote zones
Early accessGated collections or launch timingIdentity at login
ExperiencesManual or partner fulfilmentCapacity and fairness
14

How to Build a Loyalty Program Step by Step

  • 1. Agree program rules and economics with marketing and finance
  • 2. Decide build or buy, and the channels it must cover
  • 3. Define member identity across web, app and POS
  • 4. Build event intake from orders, refunds and other actions, idempotently
  • 5. Implement the ledger with pending, available, redeemed, reversed and expired entries
  • 6. Build redemption with reservations at checkout and POS
  • 7. Add tiers and expiry jobs with reminders
  • 8. Expose balances and rewards through APIs for the account page, emails and app, following loyalty UX patterns
  • 9. Add fraud controls and finance reports
  • 10. Connect referral rewards to the same ledger; see referral programs
15

Worked Example

An illustrative scenario, not a client case: a beauty retailer's loyalty balances are stored as a single number updated by several apps. Balances drift and support cannot explain them. The team moves to an append-only ledger fed by order, refund and POS events, adds pending points until the 30-day return window closes and gives support a ledger view. Balance complaints fall, and finance gets an outstanding points report for the first time.

16

Common Mistakes

  • Balances stored as editable numbers
  • Points available immediately and lost on returns
  • Redemption not reserved during checkout
  • Different rules online and in store
  • No finance reporting on outstanding points
  • Rules changed without versioning

Planning a loyalty build or migration?

Talk to ZSpace Labs about loyalty platform development, Shopify loyalty integrations and loyalty in your mobile app.

Start a Project
17

Loyalty Programs in Australia

Loyalty programs collect a lot of customer data, and Australian regulators have paid attention to how it is used. The ACCC reviewed customer loyalty schemes' data practices in a 2019 report.

  • Explain clearly what data the program collects and how it is used and shared.
  • If covered by the Privacy Act, collect only what the program needs and offer opt-outs from targeted marketing; see the OAIC's guidance on tracking pixels for linked online tracking.
  • Marketing emails and SMS need consent under the Spam Act.
  • Make terms fair and clear; unfair terms in standard form consumer contracts can attract penalties.
  • Buy before building: loyalty apps and platforms suit most stores; build for distinctive mechanics or deep integration. See Shopify development in Australia and hospitality software.
18

Conclusion

A loyalty program is only as trustworthy as its ledger. Feed it from every channel, apply versioned rules, keep points pending through return windows, reserve redemptions like payments and give finance the data it needs. Related: loyalty strategy, loyalty UX and referral programs. For stored-value cards and Australian expiry rules, see gift card platform development.

FAQ

Common questions.

Designing and building the systems behind a rewards program: event intake from orders and other actions, an earning rules engine, a points ledger, tiers, redemption at checkout and in store, expiry, customer-facing views and integrations with commerce, POS, email and finance.

Most brands buy a loyalty app or platform and integrate it. Building suits businesses with unusual programs, several channels and brands, or loyalty as a core part of the product, with a team to maintain it.

An append-only record of every points change (earned, pending, redeemed, expired, reversed, adjusted) with references to the source event. Balances are calculated from the ledger rather than stored as a single editable number.

So points earned on orders that are later returned or cancelled can be reversed before customers spend them. Points usually become available after the return window.

Customers apply points as a discount or reward, the system reserves the points during checkout, deducts them when the order is placed and restores them if the order is cancelled.

Tiers are calculated from qualifying activity, such as spend in a rolling 12 months, on a schedule or after each order, with rules for upgrades, downgrades and grace periods.

Often. Unredeemed points can represent a liability, and revenue recognition standards such as IFRS 15 and ASC 606 can require part of the sale to be deferred. Ask your finance team or accountant how your program should be recorded.

Delay availability until returns windows close, cap earning on non-purchase actions, detect duplicate accounts, require verification for large redemptions and monitor unusual earning patterns.

Yes, if customers are identified at POS (phone, email or app ID) and both channels write to the same ledger through the same rules.

Strategy covers what behaviour to reward and the economics; UX covers how customers see and use the program. This guide covers the systems that make both work.

Get in touch

Have a project in mind?

Whether you're building a new digital product, improving an existing website, or looking to automate part of your business — let's talk.