Analytics & Report Formulas
The API computes on-the-fly analytical rollups without storing pre-computed duplicate summaries, ensuring data never falls out of sync.
Analytical Endpoints
GET /v1/finances/reports/evolutionGET /v1/finances/reports/categoriesGET /v1/finances/reports/summaryGET /v1/finances/reports/cashflow
Key Formulas & Semantics
1. Incurred vs Adjusted Expense
- Gross Incurred Minor:
Gross Incurred = SUM(confirmed expenses amount_minor)
- Adjusted Original Minor:
When a refund is recorded in November for a purchase made in October, the adjusted report allocates the refund to October so historical comparisons reflect true net consumption.Adjusted Original = MAX(0, Gross Incurred - SUM(allocated confirmed refunds))
2. Net Cashflow
Tracks real money flow during the selected window:
Net Cashflow = (Incomes + Refunds Collected) - Total Cash Outflows
3. Hierarchical Category Roll-Up
Categories support self-referential hierarchies (parent_id).
- When querying
GET /v1/finances/reports/categories, parent groups like Auto roll up all child spending (Combustible, Peajes, Seguro) plus any direct expenses assigned directly to Auto:Total Auto = Direct Auto + SUM(Child Categories Spent) - Child categories maintain their own
direct_spent_minorwithout double counting.
4. Credit Card Settlement vs Incurred Expenses
- Purchasing a $300,000 television in 3 installments records one confirmed expense of $300,000 on purchase date.
- The 3 future installments ($100,000 each) are projected in
GET /v1/finances/installmentsand settled inGET /v1/finances/reports/cashflowon payment due dates. - Paying the credit card bill (
kind: card_payment) transfers liquidity between accounts and never counts as a second expense.