Statement Coverage Report
GET /api/v1/reports/statement-coverage
Returns, for every account, which days of a period its uploaded statements cover, the days no statement covers, how current its data is, and the statements still being processed. Use it at month end to check that every account has statements for the whole period before closing.
This differs from the Data Coverage Report, which counts transactions per day: a day with no transactions there can't be told apart from a day with no statement.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| date_from | string | Yes | - | Period start (YYYY-MM-DD, inclusive) |
| date_to | string | Yes | - | Period end (YYYY-MM-DD, inclusive) |
| accounts | string | No | all | Comma-separated account IDs to filter |
Reports cover active and retired accounts, sorted by name; quarantined accounts are left out, as in the other reports.
Example Request
curl -X GET "https://statements.finopsbricks.com/api/v1/reports/statement-coverage?date_from=2024-04-01&date_to=2024-04-30" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx"
Response
{
"data": {
"period": { "date_from": "2024-04-01", "date_to": "2024-04-30" },
"accounts": [
{
"account_id": "acc123xyz",
"account_name": "Main Business Account",
"coverage": [{ "start": "2024-04-01", "end": "2024-04-30" }],
"gaps": [],
"incomplete_statements": [],
"upload_status": {
"data_coverage_date": "2024-04-30",
"last_transaction_date": "2024-04-29",
"days_since": 3,
"status": "ok",
"upload_frequency": "monthly"
}
},
{
"account_id": "acc789def",
"account_name": "Business Credit Card",
"coverage": [
{ "start": "2024-04-01", "end": "2024-04-15" },
{ "start": "2024-04-20", "end": "2024-04-25" }
],
"gaps": [
{ "gap_start": "2024-04-16", "gap_end": "2024-04-19", "days": 4 },
{ "gap_start": "2024-04-26", "gap_end": "2024-04-30", "days": 5 }
],
"incomplete_statements": [
{
"id": "stm222ghi",
"file_name": "card-apr-2.pdf",
"period_start": "2024-04-20",
"period_end": "2024-04-25",
"step": "detect_account"
}
],
"upload_status": {
"data_coverage_date": "2024-04-25",
"last_transaction_date": "2024-04-14",
"days_since": 8,
"status": "warning",
"upload_frequency": "weekly"
}
}
]
}
}
Response Fields
Each entry in accounts has the same fields as Get Account Statement Coverage with a window: coverage clipped to the period, gaps including the days before the first statement and after the last, and the non-complete statements whose period overlaps it. An account with no statement in the period has one gap covering the whole period.
Errors
| Code | Description |
|---|---|
| 400 | date_from or date_to missing or not a YYYY-MM-DD date, or date_from is after date_to |
| 401 | Invalid or missing API credentials |
| 403 | API key lacks reports:read permission |