Liability Report

GET /api/v1/reports/liability

Returns liability transaction data grouped by category or entity over time periods. This endpoint provides the same data as the Liability Report in the web UI (both "by category" and "by entity" views).

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_fieldstringNocategoryGrouping field (category/entity)
accountsstringNoallComma-separated account IDs to filter
particularsstringNo-Filter by particulars (partial match)
entitystringNo-Filter by entity (partial match, or 'empty' for null/blank)
categorystringNo-Filter by category (partial match, or 'empty' for null/blank)

Example Request

curl -X GET "https://statements.finopsbricks.com/api/v1/reports/liability?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

{
  "data": {
    "period": {
      "date_from": "2024-01-01",
      "date_to": "2024-12-31",
      "group_by": "month",
      "group_by_field": "category"
    },
    "data": [
      {
        "category": "credit-card",
        "2024-01": {
          "inflow": 5000.00,
          "outflow": 3000.00,
          "net": 2000.00,
          "transaction_count": 15
        },
        "2024-02": {
          "inflow": 4500.00,
          "outflow": 2800.00,
          "net": 1700.00,
          "transaction_count": 12
        }
      },
      {
        "category": "loan",
        "2024-01": {
          "inflow": 0.00,
          "outflow": 1200.00,
          "net": -1200.00,
          "transaction_count": 1
        }
      }
    ],
    "accounts": [
      {
        "id": "acc123",
        "name": "Business Credit Card",
        "category": "credit_card"
      },
      {
        "id": "acc456",
        "name": "Business Loan",
        "category": "bank"
      }
    ]
  }
}

Response Fields

period

FieldTypeDescription
date_fromstringStart date of the report period
date_tostringEnd date of the report period
group_bystringTime grouping period used (day/week/month/year)
group_by_fieldstringData grouping field used (category/entity)

data

Array of liability data rows, grouped by the specified field (category or entity).

When group_by_field is category:

FieldTypeDescription
categorystringTransaction category name
[period]objectData for each time period (e.g., "2024-01", "2024-02")

When group_by_field is entity:

FieldTypeDescription
entitystringTransaction entity name
[period]objectData for each time period (e.g., "2024-01", "2024-02")

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

accounts

Array of available accounts in the organization (for filtering purposes).

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

Grouping Options

Time Grouping (group_by)

  • day: Group by calendar day (YYYY-MM-DD)
  • week: Group by week (YYYY-WW)
  • month: Group by month (YYYY-MM)
  • year: Group by year (YYYY)

Field Grouping (group_by_field)

  • category: Group liability transactions by their category field
  • entity: Group liability transactions by their entity field

Filtering

Filter by Account

Use comma-separated account IDs to limit results to specific accounts:

?accounts=acc123,acc456

Filter by Particulars

Partial match on transaction particulars:

?particulars=payment

Filter by Entity

Partial match on entity name:

?entity=Chase

Or filter for transactions with no entity:

?entity=empty

Filter by Category

Partial match on category name:

?category=credit-card

Or filter for transactions with no category:

?category=empty

Example Use Cases

Credit Card Liabilities by Month

Get monthly credit card liability data:

curl -X GET "https://statements.finopsbricks.com/api/v1/reports/liability?date_from=2024-01-01&date_to=2024-12-31&category=credit-card&group_by=month" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"

Liabilities by Bank/Entity

Group liabilities by the entity (bank/lender):

curl -X GET "https://statements.finopsbricks.com/api/v1/reports/liability?date_from=2024-01-01&date_to=2024-12-31&group_by_field=entity" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"

Daily Liability Transactions

Get day-by-day liability breakdown:

curl -X GET "https://statements.finopsbricks.com/api/v1/reports/liability?date_from=2024-01-01&date_to=2024-01-31&group_by=day" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"

Errors

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

Notes

  • All monetary values are in base currency units (not cents/paise)
  • Transactions with type: 'liability' are included in this report
  • The net field is calculated as inflow - outflow
  • Periods with no transactions are omitted from the response
  • When filtering with entity=empty or category=empty, matches transactions where the field is null or empty string