Inflow/Outflow Report

GET /api/v1/reports/inflow_outflow

Returns transaction-level inflow and outflow data for an organization over a date range. This endpoint provides the same data as the Inflow/Outflow Report in the web UI, showing all non-transfer transactions with their associated accounts.

The report excludes transfer-type transactions and focuses on income, expense, asset, liability, and unknown transaction types.

Query Parameters

ParameterTypeRequiredDefaultDescription
date_fromstringYes-Start date (YYYY-MM-DD)
date_tostringYes-End date (YYYY-MM-DD)
accountsstringNoallComma-separated account IDs to filter
particularsstringNo-Filter by particulars (partial match, case-insensitive)
entitystringNo-Filter by entity (partial match, case-insensitive, or "empty" for null/empty values)
categorystringNo-Filter by category (partial match, case-insensitive, or "empty" for null/empty values)

Example Request

curl -X GET "https://statements.finopsbricks.com/api/v1/reports/inflow_outflow?date_from=2024-01-01&date_to=2024-12-31&accounts=acc123,acc456&category=Marketing" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"

Response

{
  "data": {
    "period": {
      "date_from": "2024-01-01",
      "date_to": "2024-12-31"
    },
    "transactions": [
      {
        "id": "txn_abc123",
        "date": "2024-01-15",
        "inflow": 5000.00,
        "outflow": 0,
        "particulars": "Payment from Client A - Invoice #1234",
        "entity": "Client A",
        "category": "Revenue",
        "type": "income",
        "account": {
          "id": "acc123",
          "name": "Main Business Account",
          "category": "bank"
        }
      },
      {
        "id": "txn_def456",
        "date": "2024-01-16",
        "inflow": 0,
        "outflow": 250.50,
        "particulars": "Office supplies - Amazon",
        "entity": "Amazon",
        "category": "Office Supplies",
        "type": "expense",
        "account": {
          "id": "acc456",
          "name": "Business Credit Card",
          "category": "credit_card"
        }
      }
    ],
    "accounts": [
      {
        "id": "acc123",
        "name": "Main Business Account",
        "category": "bank"
      },
      {
        "id": "acc456",
        "name": "Business Credit Card",
        "category": "credit_card"
      }
    ]
  }
}

Response Fields

period

FieldTypeDescription
date_fromstringStart date of the report
date_tostringEnd date of the report

transactions

Array of transaction objects representing individual inflows and outflows. Transactions are ordered by date ascending.

FieldTypeDescription
idstringTransaction ID
datestringTransaction date (YYYY-MM-DD)
inflownumberInflow amount in base currency units (e.g., dollars, not cents)
outflownumberOutflow amount in base currency units
particularsstringTransaction description/particulars
entitystring|nullAssociated entity (vendor, customer, etc.)
categorystring|nullTransaction category
typestringTransaction type: income, expense, asset, liability, or unknown
accountobject|nullAccount information (see below)

account (nested in transactions)

FieldTypeDescription
idstringAccount ID
namestringAccount name
categorystringAccount category (bank or credit_card)

accounts

Array of account objects available in the organization. Only includes non-archived accounts, ordered by name.

FieldTypeDescription
idstringAccount ID
namestringAccount name
categorystringAccount category (bank or credit_card)

Filtering Behavior

Date Range

  • Both date_from and date_to are required
  • Date range is inclusive on both ends
  • Transactions are returned in ascending date order

Account Filter

  • Accepts comma-separated list of account IDs
  • When omitted, returns transactions from all accounts
  • Example: accounts=acc123,acc456,acc789

Particulars Filter

  • Case-insensitive partial match
  • Example: particulars=Amazon matches "Amazon.com", "amazon prime", "AMAZON WEB SERVICES"

Entity Filter

  • Case-insensitive partial match
  • Special value "empty" returns transactions with null or empty entity
  • Example: entity=Client matches "Client A", "Big Client Corp", "[email protected]"

Category Filter

  • Case-insensitive partial match
  • Special value "empty" returns transactions with null or empty category
  • Example: category=Marketing matches "Marketing", "Marketing/Digital", "marketing expenses"

Transaction Type

  • The API automatically excludes transfer type transactions
  • Only returns: income, expense, asset, liability, and unknown types

Use Cases

Daily Cash Flow Visualization

Use this endpoint to build charts showing daily inflows vs outflows over time:

const transactions_by_date = {};
data.transactions.forEach(txn => {
  if (!transactions_by_date[txn.date]) {
    transactions_by_date[txn.date] = { inflow: 0, outflow: 0 };
  }
  transactions_by_date[txn.date].inflow += txn.inflow;
  transactions_by_date[txn.date].outflow += txn.outflow;
});

Category Analysis

Filter by category to analyze spending or revenue in specific categories:

curl "https://statements.finopsbricks.com/api/v1/reports/inflow_outflow?date_from=2024-01-01&date_to=2024-12-31&category=Marketing"

Uncategorized Transactions

Find transactions that need categorization:

curl "https://statements.finopsbricks.com/api/v1/reports/inflow_outflow?date_from=2024-01-01&date_to=2024-12-31&category=empty"

Errors

CodeDescription
400date_from and date_to are required
400Invalid date format (must be YYYY-MM-DD)
400date_from is after date_to
401Invalid or missing API credentials
403API key lacks reports:read permission

Notes

  • All monetary values are in base currency units (not cents/paise)
  • The internal system stores values as integers (multiplied by 1000), but the API returns them converted to base units
  • Transactions with null accounts are included (account field will be null)
  • Only non-archived accounts are included in the accounts array
  • The report complements the Transfer Report (which only shows transfer-type transactions)