Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to Design a User Wallet Feature in Bubble

A user wallet in Bubble uses a Wallet Data Type linked to each user with a balance field and a Transaction Data Type recording all credits and debits. This tutorial covers designing the wallet data model with proper balance tracking, building the wallet dashboard UI with balance display and transaction history, implementing send and receive money flows between users, and creating a top-up interface connected to Stripe for adding funds.

What you'll learn

  • How to design a wallet data model with balance and transaction tracking
  • How to build a wallet dashboard with balance and transaction history
  • How to implement user-to-user transfers safely
  • How to create a top-up flow connected to payment processing
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read25-30 minAll Bubble plansMarch 2026RapidDev Engineering Team
TL;DR

A user wallet in Bubble uses a Wallet Data Type linked to each user with a balance field and a Transaction Data Type recording all credits and debits. This tutorial covers designing the wallet data model with proper balance tracking, building the wallet dashboard UI with balance display and transaction history, implementing send and receive money flows between users, and creating a top-up interface connected to Stripe for adding funds.

Overview: User Wallet in Bubble

This tutorial shows you how to build a digital wallet feature where users can view their balance, see transaction history, send money to other users, and add funds through payment processing.

Prerequisites

  • A Bubble app with user authentication
  • A Stripe account for payment processing (optional)
  • Basic understanding of Data Types and Workflows
  • Familiarity with number fields and calculations in Bubble

Step-by-step guide

1

Design the wallet data model

Create a 'Wallet' Data Type with: user (User — one wallet per user), balance (number — current balance in cents to avoid floating point issues), currency (text — e.g. 'USD'). Create a 'WalletTransaction' Data Type with: wallet (Wallet), type (text — credit/debit), amount (number — in cents), description (text), counterparty (User — who the transfer is with), reference_id (text — external payment ref), balance_after (number — balance snapshot after transaction), Created Date. Create the wallet record automatically when a user signs up.

Expected result: Wallet and WalletTransaction Data Types support balance tracking and full transaction history.

2

Build the wallet dashboard

Create a wallet page showing: a large balance display formatted as currency (divide cents by 100), a row of action buttons (Top Up, Send, Receive), and a Repeating Group of WalletTransactions sorted by Created Date descending. Each transaction row shows: icon (green arrow up for credit, red arrow down for debit), description, amount (formatted as +$XX.XX or -$XX.XX), balance after transaction, and date. Add filters above the list: date range picker and type filter (all/credits/debits). Add a summary section showing total credits and debits this month.

Expected result: Users see their current balance, transaction history, and action buttons on the wallet dashboard.

3

Implement the top-up flow

When the Top Up button is clicked, show a popup with pre-set amount buttons ($10, $25, $50, $100) and a custom amount input. On confirmation, initiate a Stripe Checkout session for the selected amount. On successful payment (via Stripe webhook), create a WalletTransaction with type = 'credit', the amount, description = 'Top up via card', reference_id = Stripe charge ID, and update the Wallet balance by adding the amount. Set balance_after to the new balance.

Expected result: Users can add funds to their wallet via credit card payment.

4

Implement user-to-user transfers

When the Send button is clicked, show a popup with: a user search input (to find the recipient), an amount input, and an optional note. Validate that the sender has sufficient balance. In the workflow: create a debit WalletTransaction for the sender (amount subtracted from balance), create a credit WalletTransaction for the recipient (amount added to balance), update both Wallets. Use a backend workflow for this to ensure atomicity — if any step fails, the whole transfer should not partially complete.

Pro tip: Always use backend workflows for transfers to maintain data consistency. Check the sender's balance inside the backend workflow to prevent race conditions where two transfers drain the account simultaneously.

Expected result: Users can send money to other users with proper balance validation and atomic transfer processing.

5

Add security and audit features

Add transaction verification by requiring a PIN or password confirmation before transfers above a threshold amount. Log all wallet operations in a separate AuditLog Data Type for compliance. Add a daily balance reconciliation backend workflow that compares each Wallet's balance against the sum of all its transactions to detect discrepancies. Display a transaction receipt after each operation with a unique reference number. Add low-balance alerts that notify users when their balance drops below a configured threshold.

Expected result: The wallet system includes security verification, audit logging, balance reconciliation, and user alerts.

Complete working example

Workflow summary
1USER WALLET SYSTEM SUMMARY
2=====================================
3
4DATA MODEL:
5 Wallet: user, balance (cents), currency
6 WalletTransaction: wallet, type (credit/debit),
7 amount (cents), description, counterparty,
8 reference_id, balance_after, Created Date
9
10WALLET DASHBOARD:
11 Balance: Wallet's balance / 100 as currency
12 Actions: Top Up, Send, Receive buttons
13 History: RG of transactions (desc by date)
14 Credit: green +$XX.XX
15 Debit: red -$XX.XX
16 Filters: date range, type
17 Summary: monthly credits/debits
18
19TOP UP FLOW:
20 Amount selection Stripe Checkout
21 Webhook: payment success
22 Create credit WalletTransaction
23 Update Wallet balance += amount
24 Set balance_after
25
26TRANSFER FLOW (BACKEND WORKFLOW):
27 1. Validate sender balance >= amount
28 2. Create debit transaction (sender)
29 3. Update sender Wallet balance -= amount
30 4. Create credit transaction (recipient)
31 5. Update recipient Wallet balance += amount
32 6. Notify both parties
33
34SECURITY:
35 PIN/password for large transfers
36 Audit log for all operations
37 Daily balance reconciliation
38 Low-balance alerts

Common mistakes when designing a User Wallet Feature in Bubble

Why it's a problem: Using floating point numbers for balance instead of integers (cents)

How to avoid: Store all monetary values in cents (integers). Divide by 100 only for display formatting.

Why it's a problem: Processing transfers in frontend workflows

How to avoid: Use backend workflows for all balance-changing operations to ensure atomicity and prevent partial transfers

Why it's a problem: Not recording balance_after on each transaction

How to avoid: Calculate and store balance_after on every WalletTransaction for audit and display purposes

Best practices

  • Store monetary values in cents (integers) to avoid floating point errors
  • Use backend workflows for all balance-changing operations
  • Record balance_after on every transaction for audit trails
  • Validate sufficient balance before processing debits
  • Run daily balance reconciliation to detect discrepancies
  • Require additional verification for large transfers
  • Log all operations in an audit trail for compliance

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I want to build a digital wallet feature in my Bubble.io app where users can top up with Stripe, send money to each other, and see transaction history. How should I design the data model?

Bubble Prompt

Help me build a user wallet with balance display, transaction history list, top-up via Stripe, and user-to-user transfer capability with proper security validation.

Frequently asked questions

Should I store money values as dollars or cents?

Always store in cents (integers). $10.50 becomes 1050. This avoids floating point arithmetic errors that occur with decimal numbers.

How do I handle negative balances?

Validate balance >= transfer amount before processing any debit. If your business allows negative balances (credit), add a credit_limit field to the Wallet.

Is a Bubble wallet suitable for real money?

For real money applications, consult with a financial compliance expert. Depending on your jurisdiction, you may need money transmitter licenses. Platform credits and virtual currencies have fewer regulatory requirements.

Can I add multiple currencies?

Yes. Add a currency field to Wallet and WalletTransaction. Implement exchange rates and conversion logic for cross-currency transfers.

How do I handle refunds?

Create a credit WalletTransaction referencing the original debit transaction. Update the Wallet balance by adding the refund amount.

Can RapidDev help build a wallet system?

Yes. RapidDev can build secure digital wallet systems in Bubble including payment integration, transfer logic, fraud prevention, and compliance features.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.