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
| 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 | Grouping 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, or 'empty' for null/blank) |
| category | string | No | - | 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
| Field | Type | Description |
|---|---|---|
| date_from | string | Start date of the report period |
| date_to | string | End date of the report period |
| group_by | string | Time grouping period used (day/week/month/year) |
| group_by_field | string | Data 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:
| Field | Type | Description |
|---|---|---|
| category | string | Transaction category name |
| [period] | object | Data for each time period (e.g., "2024-01", "2024-02") |
When group_by_field is entity:
| Field | Type | Description |
|---|---|---|
| entity | string | Transaction entity name |
| [period] | object | Data for each time period (e.g., "2024-01", "2024-02") |
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 |
accounts
Array of available accounts in the organization (for filtering purposes).
| Field | Type | Description |
|---|---|---|
| id | string | Account ID |
| name | string | Account name |
| category | string | Account 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
| Code | Description |
|---|---|
| 400 | Missing required parameters (date_from and date_to are required) |
| 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/year) |
| 400 | Invalid group_by_field value (must be category/entity) |
| 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)
- Transactions with
type: 'liability'are included in this report - The
netfield is calculated asinflow - outflow - Periods with no transactions are omitted from the response
- When filtering with
entity=emptyorcategory=empty, matches transactions where the field is null or empty string