tickets and tickets_blocked tables.
Virtual office functions mirror the core ticket operations (
tickets_lock, tickets_list_event_sales, tickets_unlock_param) but are namespaced with _virtual to allow separate permission scoping and auditing for online sales channels.List All Event Tickets
tickets_list_event_virtual returns every ticket for an event. This is typically used to render a seat map before a customer selects seats.
The event ID to list tickets for.
Response Fields
true when tickets were found.Full ticket rows from the
tickets table. Includes all columns: ticket_id, seat_id, zone, color, status, access_status, access_entry, event_id, event_name, seat_row, ledger, date_start, date_end, date_created, date_updated.List Tickets with Sales Status
tickets_list_event_sales_virtual returns tickets with a computed status that reflects both sold state and active holds. Use this endpoint to show a customer-facing seat map where temporarily reserved seats appear as unavailable.
The event ID to fetch the sales view for.
Response Fields
Computed field.
false if the ticket is either blocked in tickets_blocked (status_d is set by the LEFT JOIN) or already sold (status = false in tickets). true only when the seat is both unblocked and unsold.The raw
status column value from tickets before block evaluation.true when the ticket has been assigned to an offline office and is not available for online purchase.Lock Tickets (Reserve for Checkout)
tickets_lock_virtual places a time-limited hold on one or more tickets, preventing them from being sold to another customer while the first customer is in the checkout flow.
Array of composite ticket IDs to lock. All tickets must be available (unsold and not already blocked) or the entire request is rejected.
Hold duration in seconds. The
locked_up timestamp is computed as now() + reserved_time. After this time the hold expires and the ticket becomes available again.Validation Logic
The function performs two checks before inserting intotickets_blocked:
- Sold check — Queries
ticketsfor the requested IDs. Any ticket wherestatus = false(already sold) is added tonodisponibleand the request fails. - Block check — Queries
tickets_blockedfor the same IDs. Any already-blocked ticket is added tonodisponibleand the request fails.
Unlock Tickets by ID
tickets_unlock_param_virtual explicitly releases holds for specific tickets, typically called when a customer abandons the checkout or after a successful order is created.
Array of composite ticket IDs to release from
tickets_blocked. Deletes matching rows regardless of whether locked_up has expired.