Asset Report
GET /api/v1/reports/asset
Returns asset transaction data grouped by category or entity over time periods. This endpoint provides the same data as the Asset Reports in the web UI (by_category and by_entity views), which help track asset purchases, sales, and related transactions.
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) |
| group_by | string | No | month | Grouping period (day/week/month/year) |
| group_by_field | string | No | category | Group by field (category/entity) |
| accounts | string | No | all | Comma-separated account IDs to filter |
| particulars | string | No | - | Filter by particulars (partial match) |
| entity | string | No | - | Filter by entity (partial match, use 'empty' for null/empty) |
| category | string | No | - | Filter by category (partial match, use 'empty' for null/empty) |
Example Request
curl -X GET "https://statements.finopsbricks.com/api/v1/reports/asset?date_from=2024-01-01&date_to=2024-12-31&group_by=month&group_by_field=category" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx"
Response
Grouped by Category
{
"data": {
"period": {
"date_from": "2024-01-01",
"date_to": "2024-12-31",
"group_by": "month",
"group_by_field": "category"
},
"accounts": [
{
"id": "acc123",
"name": "Investment Account",
"category": "bank"
},
{
"id": "acc456",
"name": "Trading Account",
"category": "bank"
}
],
"data": [
{
"category": "Investments",
"2024-01": {
"inflow": 10000.00,
"outflow": 2000.00,
"net": 8000.00,
"transaction_count": 5
},
"2024-02": {
"inflow": 15000.00,
"outflow": 3000.00,
"net": 12000.00,
"transaction_count": 7
}
},
{
"category": "Fixed Assets",
"2024-01": {
"inflow": 50000.00,
"outflow": 0.00,
"net": 50000.00,
"transaction_count": 1
}
}
]
}
}
Grouped by Entity
When group_by_field=entity, the response uses entity instead of category:
{
"data": {
"period": {
"date_from": "2024-01-01",
"date_to": "2024-12-31",
"group_by": "month",
"group_by_field": "entity"
},
"accounts": [...],
"data": [
{
"entity": "Investment Broker",
"2024-01": {
"inflow": 10000.00,
"outflow": 2000.00,
"net": 8000.00,
"transaction_count": 5
}
}
]
}
}
Response Fields
period
| Field | Type | Description |
|---|---|---|
| date_from | string | Start date of the report |
| date_to | string | End date of the report |
| group_by | string | Grouping period used (day/week/month/year) |
| group_by_field | string | Grouping field used (category/entity) |
accounts
Array of account objects included in the report (non-archived accounts).
| Field | Type | Description |
|---|---|---|
| id | string | Account ID |
| name | string | Account name |
| category | string | Account category (bank or credit_card) |
data
Array of asset data objects grouped by category or entity (depending on group_by_field).
When group_by_field=category:
| Field | Type | Description |
|---|---|---|
| category | string | Transaction category name |
{period} | object | Period key (format depends on group_by): YYYY-MM-DD (day), YYYY-Www (week), YYYY-MM (month), YYYY (year) |
When group_by_field=entity:
| Field | Type | Description |
|---|---|---|
| entity | string | Transaction entity name |
{period} | object | Period key (format depends on group_by): YYYY-MM-DD (day), YYYY-Www (week), YYYY-MM (month), YYYY (year) |
Each period object contains:
| Field | Type | Description |
|---|---|---|
| inflow | number | Total inflows for the period (in base currency units) |
| outflow | number | Total outflows for the period (in base currency units) |
| net | number | Net amount (inflow - outflow) |
| transaction_count | number | Total number of transactions (inflows + outflows) |
Understanding Asset Reports
Asset reports show transactions categorized as "asset" type, which represent purchases, sales, or movements of assets. Key use cases:
- Asset Tracking: Monitor purchases and sales of investments, equipment, or other assets
- Investment Analysis: Track investment inflows (purchases) and outflows (sales)
- Category Analysis: Group assets by category (Investments, Fixed Assets, Inventory, etc.)
- Entity Analysis: Group assets by entity (broker names, vendors, etc.)
Interpreting Net Values
- Positive net: More asset purchases than sales (asset accumulation)
- Negative net: More asset sales than purchases (asset liquidation)
- Inflow: Asset purchases or acquisitions
- Outflow: Asset sales or disposals
Grouping Options
By Category (default)
Use group_by_field=category or omit the parameter to group by transaction category:
- View asset activity across different asset types
- Example categories: "Investments", "Fixed Assets", "Inventory", "Equipment"
By Entity
Use group_by_field=entity to group by transaction entity:
- View asset activity by broker, vendor, or counterparty
- Example entities: "Investment Broker", "Equipment Supplier", "Trading Platform"
Filtering Options
Special Values
- entity='empty': Filters for transactions with null or empty entity field
- category='empty': Filters for transactions with null or empty category field
Partial Matching
The particulars, entity, and category filters use case-insensitive partial matching:
particulars=stockmatches "Stock Purchase", "STOCK SALE", "stock investment"entity=brokermatches "Investment Broker", "BROKER LLC", "Brokerage Account"
Account Filtering
Pass comma-separated account IDs to filter transactions:
accounts=acc123- Single accountaccounts=acc123,acc456,acc789- Multiple accounts
Errors
| Code | Description |
|---|---|
| 400 | Missing date_from or date_to parameter |
| 400 | Invalid date format (must be YYYY-MM-DD) |
| 400 | date_from is after date_to |
| 400 | Invalid group_by value (must be day, week, month, or year) |
| 400 | Invalid group_by_field value (must be category or entity) |
| 401 | Invalid or missing API credentials |
| 403 | API key lacks reports:read permission |