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/summary endpoint aggregates all transactions in a given date range and returns a single object containing the total income, total expense, and the resulting net profit. It is the simplest of the finance endpoints and is best used when you need a single high-level snapshot of financial performance over a period — for example, to answer “how did the business perform in Q3 2025?” without needing a month-by-month breakdown. Both from and to dates are inclusive.

Request

from
string
required
Start of the date range in YYYY-MM-DD format. The date is inclusive — transactions on this exact date are included in the totals.
to
string
required
End of the date range in YYYY-MM-DD format. The date is inclusive — transactions on this exact date are included in the totals.

Response

from
string
The start date echoed back from the request, in YYYY-MM-DD format.
to
string
The end date echoed back from the request, in YYYY-MM-DD format.
income
number
Total income across all departments and revenue categories in the date range.
expense
number
Total expense across all departments and expense categories in the date range.
net
number
Net profit for the period, calculated as income - expense. A positive value indicates a profitable period; a negative value indicates a loss.

Example

Request

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

Response

{
  "from": "2025-01-01",
  "to": "2025-12-31",
  "income": 1250000.00,
  "expense": 980000.00,
  "net": 270000.00
}

Error Response

If either from or to is missing, the endpoint returns a 400 Bad Request:
{
  "error": {
    "formErrors": [],
    "fieldErrors": {
      "from": ["Required"]
    }
  }
}

Build docs developers (and LLMs) love