# How to build e-ticketing in Bubble

- Tool: Bubble
- Difficulty: Beginner
- Time required: 30-35 min
- Compatibility: All Bubble plans (QR plugin required)
- Last updated: March 2026

## TL;DR

An e-ticketing system in Bubble generates QR code digital tickets after purchase, delivers them via email, and validates them at entry using a QR scanner. This tutorial covers building the ticket purchase flow, generating unique QR codes, implementing email delivery, and creating a validation interface to prevent ticket fraud and duplication.

## Overview: Building an E-Ticketing System in Bubble

This tutorial walks through building a digital ticketing system for events, venues, or transportation. You will create a ticket purchase flow with payment, generate unique QR-coded e-tickets, deliver them via email, and build a validation interface for scanning and verifying tickets at the door. The system prevents duplication and fraud through unique ticket codes and single-use validation.

## Before you start

- A Bubble account with an app
- Stripe plugin installed for payment processing
- A QR code generator plugin installed from the marketplace
- Understanding of Bubble Data Types and backend workflows

## Step-by-step guide

### 1. Create the Event and Ticket Data Types

In the Data tab, create an Event Data Type with fields: name (text), date (date), venue (text), description (text), ticket_price (number), total_tickets (number), tickets_sold (number, default 0), and organizer (User). Create a Ticket Data Type with: event (Event), purchaser (User), ticket_code (text — unique 12-character alphanumeric string), qr_data (text — URL containing the ticket code), status (text — valid/used/cancelled), purchased_at (date), and used_at (date, optional). The ticket_code is the unique identifier embedded in the QR code.

**Expected result:** Event and Ticket Data Types created with all fields for the e-ticketing system.

### 2. Build the event listing and ticket purchase flow

Create an 'events' page with a Repeating Group showing upcoming Events (date > Current Date/Time). Each card displays the event name, date, venue, price, and tickets remaining (total_tickets - tickets_sold). Add a 'Buy Ticket' button. When clicked, check tickets_sold < total_tickets (Only when condition). Navigate to a checkout page or show a popup with Stripe payment. After successful payment, create a Ticket record with a generated ticket_code (use a random alphanumeric string), set status to 'valid', and increment the Event's tickets_sold by 1.

> Pro tip: Generate the ticket_code using Bubble's arbitrary text with random characters to ensure uniqueness. Check for existing codes before saving to prevent rare collisions.

**Expected result:** Users can browse events and purchase tickets with automatic ticket generation after payment.

### 3. Generate QR code e-tickets

Install a QR code generator plugin (like 'QR Code Generator' from the marketplace). On the ticket confirmation page, add the QR code element. Set its data to a URL containing the ticket_code: yourapp.com/validate?code=[Ticket's ticket_code]. This URL will be used for scanning and validation. Also display the ticket details: event name, date, venue, purchaser name, and ticket code as text backup. Style the ticket like a real event ticket with the event branding, a clear QR code area, and the essential details.

**Expected result:** A visual e-ticket with a QR code that encodes the validation URL and displays event details.

### 4. Set up automatic email delivery of tickets

After the Ticket is created (in the purchase workflow), use the Send Email action to deliver the ticket to the purchaser. Include the event name, date, venue, and ticket code in the email body. For the QR code image in the email, use a QR code API service (like api.qrserver.com/v1/create-qr-code/?data=[ticket_url]&size=200x200) to generate a QR image URL that renders in the email. Add a link to view the ticket online: yourapp.com/my-ticket?code=[ticket_code]. Also send a reminder email 24 hours before the event using a scheduled backend workflow.

**Expected result:** Purchasers receive an email with their e-ticket, QR code, and event details immediately after purchase.

### 5. Build the ticket validation interface for entry scanning

Create a 'validate' page that reads the ticket_code from the URL parameter. Search for a Ticket where ticket_code = the URL parameter. Display the validation result: if status is 'valid', show a green checkmark with 'VALID TICKET' and the event/purchaser details. Add a 'Mark as Used' button that changes the Ticket status to 'used' and sets used_at to Current Date/Time. If status is 'used', show a red warning with 'ALREADY USED' and the time it was used. If no ticket is found, show 'INVALID TICKET'. For mobile scanning, install a QR scanner plugin that reads QR codes via the device camera and redirects to the validation URL.

**Expected result:** Event staff can scan QR codes or enter ticket codes to validate tickets and prevent re-entry.

### 6. Add fraud prevention and ticket management

Implement several fraud prevention measures: add Privacy Rules so only the ticket owner and admin users can view Ticket records. Create a backend workflow that runs after marking a ticket as used — if the same ticket_code is submitted again within 5 minutes, log a Fraud_Attempt record. Add an admin dashboard showing all tickets for an event with their statuses, allowing organizers to cancel tickets (change status to 'cancelled') and monitor usage in real time. Display ticket scan statistics: total scanned, valid entries, duplicate attempts.

**Expected result:** Fraud prevention measures in place with admin visibility into ticket usage and attempted duplications.

## Complete code example

File: `Workflow summary`

```text
E-TICKETING SYSTEM SUMMARY
===========================

DATA TYPES:
  Event: name, date, venue, description, ticket_price,
    total_tickets, tickets_sold, organizer (User)
  Ticket: event, purchaser (User), ticket_code (unique 12-char),
    qr_data (URL), status (valid/used/cancelled),
    purchased_at, used_at
  Fraud_Attempt: ticket_code, scanned_at, scanned_by (User)

PURCHASE FLOW:
  1. User selects event → clicks Buy Ticket
  2. Only when: tickets_sold < total_tickets
  3. Process Stripe payment
  4. On success:
     a. Generate unique ticket_code (12 random chars)
     b. Create Ticket (status = 'valid')
     c. Increment Event tickets_sold
     d. Send email with QR code
     e. Show confirmation page

QR CODE:
  Data: yourapp.com/validate?code=[ticket_code]
  Plugin: QR Code Generator (visual display)
  Email: api.qrserver.com/v1/create-qr-code/
    ?data=[validation_url]&size=200x200

VALIDATION FLOW:
  1. Staff scans QR → opens validation URL
  2. Page reads ?code= parameter
  3. Search Ticket where ticket_code = parameter
  4. If status = 'valid':
     → GREEN: Show ticket details + Mark as Used button
     → Mark as Used: status = 'used', used_at = now
  5. If status = 'used':
     → RED: 'ALREADY USED at [used_at]'
     → Log Fraud_Attempt
  6. If not found:
     → RED: 'INVALID TICKET'

ADMIN DASHBOARD:
  - All tickets for event with status
  - Scan statistics: total, valid, duplicates
  - Cancel ticket button
  - Real-time entry count
```

## Common mistakes

- **Not checking ticket availability before processing payment** — Without a check, you can oversell tickets — processing payment for tickets that do not exist Fix: Add an Only when condition checking tickets_sold < total_tickets before initiating the payment workflow
- **Using sequential numbers as ticket codes** — Sequential codes are predictable — someone could guess valid ticket codes and forge entries Fix: Generate random 12+ character alphanumeric strings for ticket codes to prevent guessing
- **Not marking tickets as used after validation** — Without marking used tickets, the same QR code can be scanned multiple times for multiple entries Fix: The validation page must change the ticket status to 'used' and record the timestamp when the entry is confirmed

## Best practices

- Generate random 12+ character ticket codes to prevent guessing
- Mark tickets as 'used' immediately upon validation with a timestamp
- Send ticket emails immediately after purchase and reminder emails 24 hours before the event
- Add Privacy Rules so only ticket owners and admins can view ticket records
- Log all validation attempts including duplicates for fraud detection
- Check ticket availability in real time before processing payment to prevent overselling

## Frequently asked questions

### Which QR code plugin should I use in Bubble?

The 'QR Code Generator' plugin from the marketplace works well for displaying QR codes. For scanning, look for a plugin with camera-based QR reading capability for mobile devices.

### Can I generate different ticket types (VIP, General)?

Yes. Add a ticket_type field (Option Set) to the Ticket Data Type and a corresponding pricing structure on the Event. Create separate purchase flows or a selection dropdown for each tier.

### How do I handle ticket refunds?

Change the Ticket status to 'cancelled' and process the Stripe refund via the API. Add refund logic that decrements the Event's tickets_sold count.

### Can tickets be transferred to another person?

Add a Transfer feature that changes the Ticket's purchaser field to a new user. Update the QR code data is not needed since it contains the ticket_code, not user info.

### How do I prevent screenshot sharing of QR codes?

Add a time-based element to the validation — show a rotating verification code on the ticket page that changes every 30 seconds, required alongside the QR scan for entry.

### Can RapidDev help build an e-ticketing platform?

Yes. RapidDev can build complete e-ticketing systems with multi-event support, tiered pricing, QR validation, payment processing, and comprehensive admin dashboards.

---

Source: https://www.rapidevelopers.com/bubble-tutorial/create-an-e-ticketing-system-in-bubble
© RapidDev — https://www.rapidevelopers.com/bubble-tutorial/create-an-e-ticketing-system-in-bubble
