# How to create a rewards system in Bubble.io: Step-by-Step Guide

- Tool: Bubble
- Difficulty: Beginner
- Time required: 25-30 min
- Compatibility: All Bubble plans
- Last updated: March 2026

## TL;DR

Build a loyalty rewards system in Bubble where users earn points on purchases and actions, redeem points for discounts, progress through tiers, and track their reward history. This tutorial covers the data model for points, tiers, and redemptions, plus workflows for earning and spending rewards.

## Overview: Rewards System in Bubble

A rewards system increases user engagement and retention by giving points for purchases and actions, letting users redeem them for discounts or perks, and offering tier-based status progression. This tutorial builds the complete rewards infrastructure in Bubble.

## Before you start

- A Bubble account with user authentication
- Basic understanding of Data Types and Workflows
- An existing purchase or action system to attach rewards to

## Step-by-step guide

### 1. Create the rewards data model

Add fields to User: points_balance (number, default 0), lifetime_points (number, default 0), reward_tier (Option Set: Bronze/Silver/Gold/Platinum). Create 'RewardTransaction': user (User), points (number, positive=earned, negative=redeemed), type (Option Set: purchase/referral/redemption/bonus), description (text), balance_after (number). Create the RewardTier Option Set with threshold attribute (Bronze: 0, Silver: 1000, Gold: 5000, Platinum: 20000).

**Expected result:** User fields and RewardTransaction data type are ready.

### 2. Build the points-earning workflow

In your purchase completion workflow, add actions: calculate points (e.g., 1 point per dollar spent). Make changes to Current User → points_balance + earned points, lifetime_points + earned points. Create RewardTransaction → user, points = earned, type = purchase, description = order details, balance_after = new balance. Check tier upgrade: if lifetime_points crosses next tier threshold, update reward_tier.

**Expected result:** Users automatically earn points on purchases with transaction logging.

### 3. Implement points redemption

On the checkout or rewards page, show the user's points balance and available rewards (e.g., 500 points = $5 off). When the user clicks Redeem: check points_balance >= cost. Make changes to User → points_balance minus cost. Create RewardTransaction with negative points, type = redemption. Apply the discount to the current order.

**Expected result:** Users can redeem points for discounts with balance validation.

### 4. Build the rewards dashboard

Create a 'rewards' page showing: current tier badge, points balance, progress bar to next tier, and a Repeating Group of RewardTransactions sorted by date descending. The progress bar width = (lifetime_points - current tier threshold) / (next tier threshold - current tier threshold) × 100%.

**Expected result:** Users see their tier status, points balance, and reward history.

### 5. Add bonus point campaigns

Create an admin page for setting up bonus campaigns. Create 'BonusCampaign' data type: name, multiplier (number, e.g., 2 for double points), start_date, end_date, category (optional). In the purchase points calculation, check if an active campaign exists and multiply points accordingly. Display an 'Earn 2X Points!' banner when a campaign is active.

**Expected result:** Admins can run bonus point campaigns that automatically multiply earned points.

## Complete code example

File: `Workflow summary`

```text
REWARDS SYSTEM — ARCHITECTURE SUMMARY
======================================

USER FIELDS:
  points_balance (number, default 0)
  lifetime_points (number, default 0)
  reward_tier (Option Set: Bronze/Silver/Gold/Platinum)

DATA TYPES:
  RewardTransaction: user, points, type, description, balance_after
  BonusCampaign: name, multiplier, start_date, end_date

TIER THRESHOLDS:
  Bronze: 0, Silver: 1000, Gold: 5000, Platinum: 20000

WORKFLOWS:
  Earn: purchase → calculate points → update balance → log transaction → check tier
  Redeem: check balance → deduct points → log transaction → apply discount
  Tier check: if lifetime_points >= next threshold → upgrade tier
  Bonus: check active campaign → multiply points by campaign multiplier
```

## Common mistakes

- **Not logging reward transactions** — Without a transaction log you cannot audit point discrepancies or show history Fix: Create a RewardTransaction record for every earn and redeem action
- **Allowing points to go negative** — Users could redeem more points than they have if there is no balance check Fix: Add an Only when condition: points_balance >= redemption cost on the redeem workflow
- **Recalculating tier on every page load instead of on point changes** — Unnecessary computation on every page view wastes workload units Fix: Update the tier only in the earn/redeem workflows when lifetime_points changes

## Best practices

- Log every point change as a RewardTransaction for auditing
- Store both current balance and lifetime total for tier calculations
- Use Option Sets for tiers with threshold attributes for easy tier management
- Validate sufficient balance before redemption at the workflow level
- Run bonus campaigns to drive engagement during slow periods
- Send notifications when users reach new tiers

## Frequently asked questions

### Can points expire?

Yes. Add an expiry_date field to RewardTransaction. Run a scheduled backend workflow to deduct expired points and create an expiration transaction.

### Can I have different point values per product?

Yes. Add a points_value field to your Product data type. Use it in the earning calculation instead of a flat per-dollar rate.

### How do I handle refunds?

When a purchase is refunded, create a RewardTransaction with negative points (type = refund) and deduct from the user's balance.

### Can users transfer points to each other?

Yes. Create a transfer workflow that deducts from sender and credits recipient, logging both transactions.

### What is a good points-to-dollar ratio?

Common ratios are 100 points = $1 or 10 points = $1. Choose a ratio that makes earning feel achievable but sustainable for your business.

### Can RapidDev build a loyalty program?

Yes. RapidDev designs and implements loyalty programs with points, tiers, referral bonuses, and integration with payment systems.

---

Source: https://www.rapidevelopers.com/bubble-tutorial/create-a-rewards-system-in-bubble
© RapidDev — https://www.rapidevelopers.com/bubble-tutorial/create-a-rewards-system-in-bubble
