/bubble-tutorials

How to build a user wallet feature in Bubble

Learn how to build a secure, scalable user wallet in Bubble with step-by-step guidance for payments, balances, and workflows.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a Free Consultation

How to build a user wallet feature in Bubble

A wallet in Bubble is just a field on the User (for example Balance as a number) plus a safe way to change it using backend workflows. The user never updates their own balance directly in the browser. Instead, you run an API Workflow that receives an amount and safely adds or subtracts it. Each change should also create a Transaction entry so you always have a history.

 

Core Structure

 

The simplest working wallet uses a number field on the User: balance. Every time money enters or leaves, you trigger a backend workflow that updates this field. You should also create a Transaction data type containing amount, type (credit or debit), and the user, so you can show statements later.

  • Create a field on User called balance (type: number, default 0).
  • Create a data type Transaction with fields: user (User), amount (number), type (text), reference (text).
  • Create a backend workflow “wallet-adjust”. It accepts inputs: user (User) and amount (number).

 

Backend Workflow Logic

 

Inside the backend workflow, safely change the balance using “Make changes to thing → User”. Then log a Transaction entry. This ensures calculations happen on the server, not the user’s device.

 

// Step 1: Update user balance
Make changes to User (workflow input user):
balance = This User's balance + amount

// Step 2: Log a transaction
Create a new Transaction:
user = workflow input user
amount = amount
type = amount > 0 ? "credit" : "debit"
reference = "Wallet adjustment"

 

Triggering the Wallet Update

 

On any page, when a user performs an action (like deposit, refund, payout), call the backend workflow using “Schedule API workflow”. You pass the current user and the amount. Amount can be positive (add) or negative (subtract). This avoids any race conditions from multiple updates happening at once.

  • On button click → “Schedule API workflow → wallet-adjust”.
  • Set user = Current User.
  • Set amount = 10 (or dynamic value).

 

Privacy Rules

 

In Privacy settings, only allow the Current User to see their own balance. Never allow users to modify their own balance. Backend workflows bypass privacy rules safely.

  • User: When Current User is This User → allow “View balance”.
  • Never allow “Modify balance”.

 

Displaying the Wallet

 

On the dashboard, just show Current User's balance and a repeating group of Transactions filtered by user = Current User, sorted by Created Date descending.

Explore More Valuable No-Code Resources

How to integrate Bubble.io with Git?

Learn how to seamlessly integrate Bubble.io with Git through our comprehensive step-by-step guide. Perfect for beginners and professionals.

Explore

How to integrate Bubble.io with Reddit Ads?

Learn how to seamlessly integrate Bubble.io with Reddit Ads using our easy step-by-step guide. Boost your ad management today!

Explore

How to integrate Bubble.io with AWS S3?

Explore our step-by-step guide on integrating Bubble.io with AWS S3, making your app development process more efficient and secure.

Explore

How to integrate Bubble.io with Lucidchart?

Follow our step-by-step guide to seamlessly integrate Bubble.io with Lucidchart, enhancing your workflow & productivity.

Explore

How to integrate Bubble.io with Kentico?

Learn how to seamlessly integrate Bubble.io and Kentico with our comprehensive, easy to follow step-by-step guide.

Explore

How to integrate Bubble.io with Box?

Discover easy-to-follow steps for integrating Bubble.io with Box. Boost your workflow and secure your files seamlessly today.

Explore

Stuck in Bubble.io? We’re here to help!

Fix broken workflows | Optimize logic | Boost performance | Scale with confidence

4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences