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

ParameterTypeRequiredDefaultDescription
date_fromstringYes-Start date (YYYY-MM-DD)
date_tostringYes-End date (YYYY-MM-DD)
group_bystringNomonthGrouping period (day/week/month/year)
group_by_fieldstringNocategoryGroup by field (category/entity)
accountsstringNoallComma-separated account IDs to filter
particularsstringNo-Filter by particulars (partial match)
entitystringNo-Filter by entity (partial match, use 'empty' for null/empty)
categorystringNo-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

FieldTypeDescription
date_fromstringStart date of the report
date_tostringEnd date of the report
group_bystringGrouping period used (day/week/month/year)
group_by_fieldstringGrouping field used (category/entity)

accounts

Array of account objects included in the report (non-archived accounts).

FieldTypeDescription
idstringAccount ID
namestringAccount name
categorystringAccount 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:

FieldTypeDescription
categorystringTransaction category name
{period}objectPeriod key (format depends on group_by): YYYY-MM-DD (day), YYYY-Www (week), YYYY-MM (month), YYYY (year)

When group_by_field=entity:

FieldTypeDescription
entitystringTransaction entity name
{period}objectPeriod key (format depends on group_by): YYYY-MM-DD (day), YYYY-Www (week), YYYY-MM (month), YYYY (year)

Each period object contains:

FieldTypeDescription
inflownumberTotal inflows for the period (in base currency units)
outflownumberTotal outflows for the period (in base currency units)
netnumberNet amount (inflow - outflow)
transaction_countnumberTotal 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=stock matches "Stock Purchase", "STOCK SALE", "stock investment"
  • entity=broker matches "Investment Broker", "BROKER LLC", "Brokerage Account"

Account Filtering

Pass comma-separated account IDs to filter transactions:

  • accounts=acc123 - Single account
  • accounts=acc123,acc456,acc789 - Multiple accounts

Errors

CodeDescription
400Missing date_from or date_to parameter
400Invalid date format (must be YYYY-MM-DD)
400date_from is after date_to
400Invalid group_by value (must be day, week, month, or year)
400Invalid group_by_field value (must be category or entity)
401Invalid or missing API credentials
403API key lacks reports:read permission