Balances workflow
The balances area in the application is about more than a raw account total. The wiki frames it as a financial position view:- current balances across internal and external accounts
- pending movements that are not yet finalized
- historical evolution over time
- operational volume that explains how balances changed
Balance interpretation rules
Before you automate reporting, keep the app’s accounting interpretation in mind:- Internal balances (
cajas, assets): positive is favorable because it means available company funds. - External balances (
cuentas corrientes): negative is favorable because it means the counterparty owes the company.
Historical snapshot for one date
UseGET /api/balances/historical?date=YYYY-MM-DD to retrieve a closing snapshot for a specific day.
This route is useful for:
- reconciliation at period close
- point-in-time liquidity checks
- rebuilding the same current-vs-pending view used in the balances metrics UI
total_balancefavorable_balanceunfavorable_balance- pending balance totals for the same snapshot date
Historical range for trends
GET /api/balances/historicalGET /api/balances/historical-rangeGET /api/balances/historical-volume
GET /api/balances/historical-range?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD when you want the time series view behind the balances chart.
This endpoint returns daily grouped data, including:
- the date
- the balances recorded for that date
operation_countfor the same day
Historical volume for movement analysis
UseGET /api/balances/historical-volume?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD to analyze completed movement volume over time.
The response is grouped by:
- operation date
- operation type name
- transaction type name
- currency
Manual balance adjustments
UsePOST /api/accounts/{id}/manual-balance when an account needs a direct correction.
The request body supports one of two patterns:
- Set a new absolute
balance - Apply an
adjustmentdelta
balance_before, balance_after, and the effective adjustment, which makes this endpoint suitable for audit-friendly reconciliation tooling.
Because this route writes directly to the ledger-backed account balance, use it only for controlled correction workflows, not for normal operational movement.
Notes from the application wiki
- The balances area in the app also highlights DSO and exchange-rate management as analysis tools.
- Those concepts are part of the broader balances module, but the workflow endpoints above focus on snapshots, movement volume, and direct balance corrections.