Creating invoices in Bubble involves building an invoice form with line items, automatic tax and total calculation, due date management, and status tracking for paid and overdue invoices. This tutorial covers the complete invoice creation workflow from data structure through PDF generation and email delivery.
Overview: Creating Invoices in Bubble
This tutorial walks through building a manual invoice creation system in Bubble. You will create an invoice form with dynamic line items, automatic calculations for subtotals and tax, due date tracking, and status management for paid and overdue invoices. Perfect for freelancers, agencies, and small businesses who need to bill clients directly from their Bubble app.
Prerequisites
- A Bubble account with an app
- A Client or Customer Data Type already set up
- Basic understanding of Bubble Data Types and workflows
- Familiarity with Repeating Groups for dynamic lists
Step-by-step guide
Create the Invoice and Line Item Data Types
Create the Invoice and Line Item Data Types
In the Data tab, create an Invoice Data Type with fields: invoice_number (text — auto-generated unique identifier), client (your Client/Customer Data Type), issue_date (date), due_date (date), status (text — draft/sent/paid/overdue), subtotal (number), tax_rate (number — percentage), tax_amount (number), total (number), notes (text), and created_by (User). Create a Line_Item Data Type with: invoice (Invoice), description (text), quantity (number), unit_price (number), and line_total (number). The line_total is calculated as quantity times unit_price.
Expected result: Invoice and Line_Item Data Types created with all fields for invoicing.
Build the invoice creation form with dynamic line items
Build the invoice creation form with dynamic line items
Create a 'create-invoice' page. Add a form Group with: a Dropdown for client selection (data source: Search for Clients), a Date Picker for issue_date (default: today), a Date Picker for due_date (default: 30 days from today), and an Input for notes. Below the header, add a Repeating Group of type Line_Item for the line items section. Since we are creating items dynamically, use a custom state on the page called temp_items (list of texts — each text is a JSON-like string for description, qty, price). Add an 'Add Line Item' button that appends a new empty row. Each row has inputs for description, quantity, and unit_price.
Pro tip: Use a simpler approach: create Line_Item records as 'draft' items linked to a temporary invoice, then finalize when the user saves.
Expected result: An invoice form with client selection, dates, and a dynamic list of line items that can be added and removed.
Implement automatic calculations for totals
Implement automatic calculations for totals
For each line item row, calculate the line_total dynamically: set a Text element to display quantity input's value times unit_price input's value. For the invoice totals section, display: Subtotal = sum of all line totals (use the Repeating Group's list of line totals :sum), Tax = Subtotal times tax_rate / 100, and Total = Subtotal + Tax. Add a tax_rate Input (default 0 for no tax). These calculations update in real time as the user enters values. When the user clicks Save, create the Invoice record and all Line_Item records with the calculated values.
Expected result: Subtotal, tax, and total calculations update automatically as the user adds or modifies line items.
Create the Save and Send Invoice workflow
Create the Save and Send Invoice workflow
Add a 'Save as Draft' button and a 'Send Invoice' button. Save as Draft: create the Invoice record with status 'draft', then create Line_Item records for each row. Send Invoice: same creation logic but set status to 'sent', plus send an email to the client with the invoice details (invoice number, line items, total, due date, and a link to view the invoice online). Generate a unique invoice_number using a format like 'INV-' followed by a sequential number or timestamp. After saving, navigate to the invoice detail page.
Expected result: Invoices can be saved as drafts or sent directly to clients via email with all details included.
Build the invoice detail page with status management
Build the invoice detail page with status management
Create an 'invoice' page (type: Invoice) displaying all invoice details: client name, invoice number, dates, line items in a Repeating Group, subtotal, tax, and total. Add status management buttons: 'Mark as Paid' (changes status to 'paid'), 'Mark as Overdue' (changes status to 'overdue'), and 'Send Reminder' (re-sends the invoice email). Use conditional formatting to color-code the status badge: green for paid, yellow for sent, red for overdue, grey for draft. Add a backend workflow scheduled for the due_date that automatically changes status from 'sent' to 'overdue' if not yet paid.
Expected result: A complete invoice view with status badges and action buttons for managing invoice lifecycle.
Create an invoice list dashboard
Create an invoice list dashboard
Create an 'invoices' page with filter tabs: All, Draft, Sent, Overdue, Paid. Add a Repeating Group showing Invoices where created_by = Current User, filtered by the selected tab's status (use Ignore empty constraints for the All tab). Each row displays invoice number, client name, issue date, due date, total, and a color-coded status badge. Add summary statistics at the top: total outstanding (sum of sent + overdue invoice totals), total paid this month, and total overdue. This gives a financial overview at a glance.
Expected result: An invoice dashboard with filter tabs, summary statistics, and a complete list of all invoices.
Complete working example
1INVOICE SYSTEM SUMMARY2=======================34DATA TYPES:5 Invoice: invoice_number, client (Client), issue_date, due_date,6 status (draft/sent/paid/overdue), subtotal, tax_rate,7 tax_amount, total, notes, created_by (User)8 Line_Item: invoice, description, quantity, unit_price, line_total910INVOICE NUMBER FORMAT:11 'INV-' + year + '-' + sequential_number12 Example: INV-2026-00421314CALCULATIONS:15 line_total = quantity × unit_price16 subtotal = sum of all line_totals17 tax_amount = subtotal × (tax_rate / 100)18 total = subtotal + tax_amount1920WORKFLOWS:21 Save as Draft:22 1. Create Invoice (status = 'draft')23 2. Create Line_Items for each row24 3. Navigate to invoice detail page2526 Send Invoice:27 1. Create Invoice (status = 'sent')28 2. Create Line_Items29 3. Send email to client with details30 4. Schedule overdue check for due_date3132 Mark as Paid:33 Make changes to Invoice → status = 'paid'3435 Auto-Overdue (Backend, scheduled for due_date):36 Only when: status is 'sent'37 Make changes to Invoice → status = 'overdue'38 Send reminder email to client3940DASHBOARD METRICS:41 Outstanding = sum(total) where status = sent OR overdue42 Paid this month = sum(total) where status = paid43 AND paid_date is in current month44 Overdue count = count where status = overdueCommon mistakes when creating invoices in Bubble
Why it's a problem: Not auto-generating unique invoice numbers
How to avoid: Auto-generate invoice numbers using a consistent format like INV-YYYY-NNNN with a sequential counter
Why it's a problem: Forgetting to implement automatic overdue detection
How to avoid: Schedule a backend workflow for the due_date that changes status to 'overdue' if the invoice is not yet paid
Why it's a problem: Calculating totals on display only without saving to the database
How to avoid: Save calculated values (subtotal, tax_amount, total) to the Invoice record when creating or updating
Best practices
- Auto-generate unique invoice numbers with a consistent format
- Save calculated totals to the database for reporting and filtering
- Schedule automatic overdue detection via backend workflows
- Send invoice emails with all details included — do not rely on links only
- Use conditional formatting to color-code invoice status badges
- Add summary statistics to the dashboard for quick financial overview
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I need to build an invoicing feature in my Bubble app for a freelance business. I need invoice creation with line items, automatic calculations, PDF generation, and status tracking (draft, sent, paid, overdue). Can you help plan the data structure?
Help me build an invoice creation page with dynamic line items, automatic subtotal/tax/total calculations, and a Send Invoice workflow that emails the client. Also set up automatic overdue detection.
Frequently asked questions
Can I generate PDF invoices in Bubble?
Yes. Use a PDF generation plugin or external API service (like PDFShift or DocRaptor) that converts your invoice page HTML to a downloadable PDF file.
How do I handle recurring invoices?
Create a Recurring_Invoice Data Type with client, items, frequency, and next_date fields. Schedule a backend workflow that creates a new Invoice from the template on each recurrence date.
Can I accept payments directly from the invoice?
Yes. Add a 'Pay Now' button on the invoice view page that creates a Stripe Checkout session for the invoice total. On successful payment, update the status to 'paid'.
How do I calculate tax for different rates?
Add a tax_rate field to the Invoice. For line-item-level tax, add a tax_rate field to Line_Item and calculate tax per item instead of on the subtotal.
Can I customize the invoice design?
Yes. The invoice detail page is a regular Bubble page — style it with your brand colors, logo, and layout. For PDF output, the PDF service will render whatever your page looks like.
Can RapidDev help build an invoicing system?
Yes. RapidDev can build complete invoicing systems with custom templates, recurring billing, payment integration, PDF generation, and financial reporting dashboards.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation