Offline Ticket Lifecycle
Assign tickets to the offline office
Call
offline_office_tickets with the list of ticket IDs, the office_id, and the event_id. The platform marks each ticket with status_offline = true and inserts records into the tickets_offline table, locking them from online sale.Sell tickets locally
The office device uses
offline_office_tickets_list_sales to display available inventory. Sales are recorded locally on the device.Synchronise completed sales
Call
offline_office_tickets_synchronization with the array of sold tickets. For each sold ticket, an order is created via the order_created callable function, replicating the sale in the central platform.Assign Tickets to Offline Office
offline_office_tickets transfers a set of available tickets to a specific offline office.
Array of composite ticket IDs to assign. All tickets must be available (
status = true) and not already assigned offline (status_offline = false). Any ticket failing either check causes the entire request to be rejected.The identifier of the offline office receiving the tickets. Stored in
tickets_offline.office_id.The event these tickets belong to. Stored in
tickets_offline.event_id.What this does
- Validates that no ticket in the list is already sold or blocked.
- Writes
status_offline = trueand appends anofflineledger entry to each ticket in both Firestore and PostgreSQL. - Inserts a row per ticket into
tickets_offlinewithticket_id,date_created,event_id, andoffice_id.
List Office Inventory
offline_office_tickets_list_sales returns the tickets assigned to a specific office for a specific event, with computed availability status.
The event to list inventory for.
The offline office to list inventory for. Uses an INNER JOIN on
tickets_offline — only tickets explicitly assigned to this office are returned.Response Fields
Array of ticket rows for this office. The query JOINs
tickets with tickets_offline on t.id = tt.ticket_id.Computed:
false if status_sold is set, true if raw status is true, otherwise false.The composite ticket ID.
The seat reference.
Zone name.
Zone hex color.
Synchronise Completed Sales
offline_office_tickets_synchronization pushes locally-recorded sales from the offline device to the central platform. For each sold ticket in the payload, it invokes the order_created callable function to create a full order record.
Array of completed sale objects recorded locally by the offline device.
The composite ticket ID that was sold.
Array of transaction objects as recorded by the offline device (forwarded as-is to
order_created).Total amount collected for this ticket.
The event ID.
The event display name.
The offline office that made the sale.
Display name of the offline office.
Order status string passed to
order_created (e.g. "completed").Array of ticket IDs included in this order (same as
ticket for single-ticket orders).The customer ID recorded by the offline device.
The customer name recorded by the offline device.
Synchronisation calls
order_created as a Firebase callable function via the Firebase client SDK. The response from order_created is not awaited per-item — the endpoint returns Sincronizado as soon as the iteration is dispatched.Unassign (Return) Tickets
offline_office_tickets_unassign returns tickets from an offline office back to the online pool. Tickets not sold during the event can be released so they become available to other sales channels.
Array of composite ticket IDs to return to online availability.
The offline office releasing the tickets.
The event these tickets belong to.
What this does
- Sets
status_offline = falseon each ticket in both Firestore and PostgreSQL. - Appends an
unassignledger entry to each ticket. - Deletes the corresponding rows from
tickets_offline.
Full Event Sales View (Offline Context)
offline_tickets_list_event_sales returns all tickets for an event with computed availability status, including offline assignment state. This is the same query shape as the virtual office sales view and is used to give operators a complete picture of event inventory.
The event to query.
Response Fields
Computed:
false if blocked (status_d) or sold. true if neither condition holds.true when the ticket is currently held by an offline office.Raw
status value from tickets before block/offline evaluation.