Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/financial-analytics-agent/llms.txt

Use this file to discover all available pages before exploring further.

The /api/finance/cashflow endpoint returns a month-by-month breakdown of income, expense, and net profit, along with a running cumulative net that accumulates from the start of the requested range. Unlike /api/finance/summary, which collapses the entire date range into a single set of totals, /api/finance/cashflow preserves the monthly structure — making it the right choice for cash flow analysis, burn rate questions, and any chart that needs to show how profitability evolved over time rather than just what it was in aggregate.

Request

from
string
required
Start of the date range in YYYY-MM-DD format. The response series begins with the month containing this date.
to
string
required
End of the date range in YYYY-MM-DD format. The response series ends with the month containing this date.

Response

The response is an array of CashflowPoint objects in chronological order, one per calendar month in the requested range.
period
string
The first day of the calendar month, in YYYY-MM-DD format.
income
number
Total income across all departments and revenue categories for this month.
expense
number
Total expense across all departments and expense categories for this month.
net
number
Net profit for this month, calculated as income - expense.
cumulativeNet
number
Running total of net from the first period in the response through the current period. The cumulative net resets to zero at the from date — it does not carry forward any balance from before the requested range.

Example

Request

curl "http://localhost:3000/api/finance/cashflow?from=2025-01-01&to=2025-12-31"

Response (truncated)

[
  {
    "period": "2025-01-01",
    "income": 98500,
    "expense": 82000,
    "net": 16500,
    "cumulativeNet": 16500
  },
  {
    "period": "2025-02-01",
    "income": 102300,
    "expense": 85100,
    "net": 17200,
    "cumulativeNet": 33700
  }
]

Error Response

{
  "error": {
    "formErrors": [],
    "fieldErrors": {
      "to": ["Required"]
    }
  }
}

Build docs developers (and LLMs) love