orders, orders_transactions, and orders_payout PostgreSQL tables, as well as Firestore collections, to return aggregated revenue and ticket data. All functions accept requests with a { "data": { ... } } body and return a { "message", "status", "data" } envelope.
total_sales
Returns total revenue grouped by date from the orders_transactions table. Accepts an optional event filter and date range.
Request parameters
Filter results to a specific event. If omitted, results span all events.
Start date in
YYYY-MM-DD format. Matches records where date_created >= from.End date in
YYYY-MM-DD format. Matches records where date_created <= to.Example request
Response
One entry per calendar date with a sale.
Grand total revenue across all dates in the result set.
Example response
total_sales_client
Returns total revenue grouped by date, filtered by client. Uses the same orders_transactions table as total_sales but filters on client_id instead of event_id.
Request parameters
Filter results to a specific client account. If omitted, all clients are included.
Start date in
YYYY-MM-DD format.End date in
YYYY-MM-DD format.Example request
Response
One entry per calendar date with a sale for the given client.
Grand total revenue for the client across the filtered period.
money_distribution
Returns revenue distributed across payment methods (custody accounts) for a given event and date range. Queries the orders_payout table, grouping by custody_account_id, custody_account_name, and amount_currency.
Request parameters
Filter to a specific event.
Start date in
YYYY-MM-DD format.End date in
YYYY-MM-DD format.Example request
Response
One entry per custody account (payment method) that received revenue.
Example response
number_tickets_vs_sold
Compares the total number of allocated seats for an event against the number of tickets that have been sold. The seat allocation is read from Firestore (events/{event_id}/setup/zones), while sold ticket counts come from the orders PostgreSQL table.
Request parameters
The event to query. Used to look up
seats_allocated from Firestore and filter the orders table.Start date in
YYYY-MM-DD format.End date in
YYYY-MM-DD format.Example request
Response
Always contains a single object with the sell-through summary.
Example response
number_tickets_sold
Returns the raw count of sold tickets from the orders table. Unlike number_tickets_vs_sold, this function does not read from Firestore and does not require a valid event zone setup.
Request parameters
Filter to a specific event.
Start date in
YYYY-MM-DD format.End date in
YYYY-MM-DD format.Example request
Response
Single-element array with the total sold count.
Example response
general_platform_data
Returns platform-wide entity counts from Firestore. No filters are accepted — this function always returns totals across the entire platform.
Request parameters
This function takes no input parameters. Send an emptydata object.
Response
Single-element array with platform totals.
Example response
general_platform_data reads four Firestore collections sequentially. For large deployments, response time scales with collection size.types_of_collaborators
Breaks down the collaborator count by account type. The list of valid account types is read from data/collaborator_types in Firestore, then each type is counted by querying the u_collaborators collection.
Request parameters
This function takes no input parameters.Response
One entry per collaborator account type defined in
data/collaborator_types.