Skip to main content
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

data.event_id
string
Filter results to a specific event. Pass null to query across all events.
data.from
string
Start date filter (inclusive). ISO 8601 date string, e.g. "2026-01-01".
data.to
string
End date filter (inclusive). ISO 8601 date string.

Response

data.distribution
array
Array of distribution entries. Each entry contains:

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

data.event_id
string
required
Event document ID. Required — used to load zone setup from Firestore.
data.from
string
Start date filter (inclusive).
data.to
string
End date filter (inclusive).

Response

data.sold
array
Single-element array containing:

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

data.event_id
string
Filter to a specific event.
data.from
string
Start date filter (inclusive).
data.to
string
End date filter (inclusive).

Response

data.office_sold
array
Per-office breakdown. Each item contains:
data.total_tickets
number
Grand total tickets sold across all offices.
data.total_amount
number
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

data.event_id
string
required
Event document ID. Used to filter offices that have this event assigned.

Response

data.result
array
Single-element array containing:

Example

curl -X POST \
  https://{region}-{project}.cloudfunctions.net/offices_vs_offices_active \
  -H 'Content-Type: application/json' \
  -d '{ "data": { "event_id": "evt_abc123" } }'

general_platform_data

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

data.result
array
Single-element array containing:

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

data.result
array
One entry per collaborator 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

data.event_id
string
Filter to a specific event.
data.from
string
Start date filter (inclusive). ISO 8601 date.
data.to
string
End date filter (inclusive). ISO 8601 date.

Response

data.totales_date
array
Daily breakdown. Each item:
data.totales
number
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

data.client_id
string
Filter results to a specific client account.
data.from
string
Start date filter (inclusive). ISO 8601 date.
data.to
string
End date filter (inclusive). ISO 8601 date.

Response

data.totales_date
array
Daily breakdown with date and total fields (same shape as total_sales).
data.totales
number
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

data.event_id
string
Filter to a specific event.
data.from
string
Start date filter (inclusive).
data.to
string
End date filter (inclusive).

Response

data.office_sold
array
Per-office, per-currency breakdown. Each item:
data.total_amount_usd
number
Grand total amount_exchange across all USD rows.
data.total_amount_bs
number
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

data.event_id
string
Filter to a specific event.
data.from
string
Start date filter (inclusive).
data.to
string
End date filter (inclusive).

Response

data.sold
array
Single-element array containing:

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 } }'

Build docs developers (and LLMs) love