All indicator functions accept an optional event_id, from, and to filter unless otherwise noted. Dates use CAST(date_created AS DATE) comparisons in PostgreSQL (ISO 8601 date strings, e.g. "2026-01-01"). All request bodies use the data envelope.
money_distribution
POST https://{region}-{project}.cloudfunctions.net/money_distribution
Returns the sum of payout amounts grouped by custody account and currency from the orders_payout PostgreSQL table.
Request body
Filter results to a specific event. Pass null to query across all events.
Start date filter (inclusive). ISO 8601 date string, e.g. "2026-01-01".
End date filter (inclusive). ISO 8601 date string.
Response
Array of distribution entries. Each entry contains: Custody account document ID.
Custody account display name.
Currency code ("USD" or "VEF").
Sum of payout amounts for this account and currency.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/money_distribution \
-H 'Content-Type: application/json' \
-d '{ "data": { "event_id": "evt_abc123", "from": "2026-01-01", "to": "2026-01-31" } }'
number_tickets_vs_sold
POST https://{region}-{project}.cloudfunctions.net/number_tickets_vs_sold
Compares total allocated seats against tickets sold for an event. seats_allocated is read from events/{event_id}/setup/zones in Firestore; sold count is computed from the PostgreSQL orders table.
Request body
Event document ID. Required — used to load zone setup from Firestore.
Start date filter (inclusive).
End date filter (inclusive).
Response
Single-element array containing: Total seats configured for the event in Firestore zones setup.
Number of tickets sold (sum of JSON array lengths from the orders.tickets column).
(seats_sold / seats_allocated) * 100.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/number_tickets_vs_sold \
-H 'Content-Type: application/json' \
-d '{ "data": { "event_id": "evt_abc123", "from": null, "to": null } }'
sold_by_office
POST https://{region}-{project}.cloudfunctions.net/sold_by_office
Returns ticket sales and revenue totals grouped by office (taquilla) for a given event and date range, sourced from the PostgreSQL orders table.
Request body
Filter to a specific event.
Start date filter (inclusive).
End date filter (inclusive).
Response
Per-office breakdown. Each item contains: Number of tickets sold by this office.
Sum of order amounts from this office.
Grand total tickets sold across all offices.
Grand total revenue across all offices.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/sold_by_office \
-H 'Content-Type: application/json' \
-d '{ "data": { "event_id": "evt_abc123", "from": "2026-01-01", "to": "2026-01-31" } }'
offices_vs_offices_active
POST https://{region}-{project}.cloudfunctions.net/offices_vs_offices_active
Counts how many offices assigned to an event are currently active vs. inactive. Reads from the offices Firestore collection and each office’s events subcollection.
Request body
Event document ID. Used to filter offices that have this event assigned.
Response
Single-element array containing: Total offices assigned to this event (active + inactive).
Offices with status: true.
Offices with status: false (or no status field).
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/offices_vs_offices_active \
-H 'Content-Type: application/json' \
-d '{ "data": { "event_id": "evt_abc123" } }'
POST https://{region}-{project}.cloudfunctions.net/general_platform_data
Returns global platform-level counts. Takes no request parameters. Reads document counts from four top-level Firestore collections.
Response
Single-element array containing: Total documents in the events collection.
Total documents in the offices collection.
Total documents in the u_collaborators collection.
Total documents in the u_clients collection.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/general_platform_data \
-H 'Content-Type: application/json' \
-d '{}'
types_of_collaborators
POST https://{region}-{project}.cloudfunctions.net/types_of_collaborators
Counts collaborators per account type. Account types are loaded from the data/collaborator_types Firestore document; each type is then queried against the u_collaborators collection by account_type.
Takes no request parameters.
Response
One entry per collaborator type: Collaborator type name (e.g. "Supervisor", "Vendedor").
Number of collaborators with this account type.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/types_of_collaborators \
-H 'Content-Type: application/json' \
-d '{}'
total_sales
POST https://{region}-{project}.cloudfunctions.net/total_sales
Returns daily sales totals from the orders_transactions PostgreSQL table, grouped by date. Optionally filters by event and date range.
Request body
Filter to a specific event.
Start date filter (inclusive). ISO 8601 date.
End date filter (inclusive). ISO 8601 date.
Response
Daily breakdown. Each item: Date (cast from date_created).
Sum of amount for that date.
Grand total across all dates in the result set.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/total_sales \
-H 'Content-Type: application/json' \
-d '{ "data": { "event_id": "evt_abc123", "from": "2026-01-01", "to": "2026-01-31" } }'
total_sales_client
POST https://{region}-{project}.cloudfunctions.net/total_sales_client
Same as total_sales but filters by client_id instead of event_id. Returns daily sales totals from orders_transactions for a specific client.
Request body
Filter results to a specific client account.
Start date filter (inclusive). ISO 8601 date.
End date filter (inclusive). ISO 8601 date.
Response
Daily breakdown with date and total fields (same shape as total_sales).
Grand total across all dates.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/total_sales_client \
-H 'Content-Type: application/json' \
-d '{ "data": { "client_id": "client_001", "from": "2026-01-01", "to": "2026-01-31" } }'
sold_by_usbs
POST https://{region}-{project}.cloudfunctions.net/sold_by_usbs
Returns revenue totals from orders_transactions grouped by office, event, and currency. Provides separate USD and VEF grand totals. This function queries amount_exchange (local currency equivalent) rather than amount.
Request body
Filter to a specific event.
Start date filter (inclusive).
End date filter (inclusive).
Response
Per-office, per-currency breakdown. Each item: Sum of amount_exchange for this group.
Grand total amount_exchange across all USD rows.
Grand total amount_exchange across all VEF rows.
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/sold_by_usbs \
-H 'Content-Type: application/json' \
-d '{ "data": { "event_id": "evt_abc123", "from": "2026-01-01", "to": "2026-01-31" } }'
number_tickets_sold
POST https://{region}-{project}.cloudfunctions.net/number_tickets_sold
Returns the total number of tickets sold for an event (or across all events) from the PostgreSQL orders table, without the seats_allocated comparison of number_tickets_vs_sold.
Request body
Filter to a specific event.
Start date filter (inclusive).
End date filter (inclusive).
Response
Single-element array containing: Total tickets sold (sum of JSON array lengths from orders.tickets).
Example
curl -X POST \
https://{region}-{project}.cloudfunctions.net/number_tickets_sold \
-H 'Content-Type: application/json' \
-d '{ "data": { "event_id": "evt_abc123", "from": null, "to": null } }'