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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| date_from | string | Yes | - | Start date (YYYY-MM-DD) |
| date_to | string | Yes | - | End date (YYYY-MM-DD) |
| accounts | string | No | all | Comma-separated account IDs to filter |
| particulars | string | No | - | Filter by particulars (partial match, case-insensitive) |
| entity | string | No | - | Filter by entity (partial match, case-insensitive, or "empty" for null/empty values) |
| category | string | No | - | 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
| Field | Type | Description |
|---|---|---|
| date_from | string | Start date of the report |
| date_to | string | End date of the report |
transactions
Array of transaction objects representing individual inflows and outflows. Transactions are ordered by date ascending.
| Field | Type | Description |
|---|---|---|
| id | string | Transaction ID |
| date | string | Transaction date (YYYY-MM-DD) |
| inflow | number | Inflow amount in base currency units (e.g., dollars, not cents) |
| outflow | number | Outflow amount in base currency units |
| particulars | string | Transaction description/particulars |
| entity | string|null | Associated entity (vendor, customer, etc.) |
| category | string|null | Transaction category |
| type | string | Transaction type: income, expense, asset, liability, or unknown |
| account | object|null | Account information (see below) |
account (nested in transactions)
| Field | Type | Description |
|---|---|---|
| id | string | Account ID |
| name | string | Account name |
| category | string | Account category (bank or credit_card) |
accounts
Array of account objects available in the organization. Only includes non-archived accounts, ordered by name.
| Field | Type | Description |
|---|---|---|
| id | string | Account ID |
| name | string | Account name |
| category | string | Account category (bank or credit_card) |
Filtering Behavior
Date Range
- Both
date_fromanddate_toare 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=Amazonmatches "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=Clientmatches "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=Marketingmatches "Marketing", "Marketing/Digital", "marketing expenses"
Transaction Type
- The API automatically excludes
transfertype transactions - Only returns:
income,expense,asset,liability, andunknowntypes
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
| Code | Description |
|---|---|
| 400 | date_from and date_to are required |
| 400 | Invalid date format (must be YYYY-MM-DD) |
| 400 | date_from is after date_to |
| 401 | Invalid or missing API credentials |
| 403 | API 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)