Balance Over Time Report

This report shows the changes to an account balance over time.

URL and Request Body Structure of a Balance Over Time Report

POST /insights/v1/reports/balance-over-time/create HTTP/1.1
Content-Type: application/json; charset=utf-8
Authorization: Token <Token>
Host: <Host>
{
    "insights_consumer_id": String,
    "insights_account_ids": ?Array<String>,
    "excluded_insights_account_ids": ?Array<String>,
    "report_days": ?Integer,
    "from_date": ?Date,
    "to_date": ?Date
}

insights_consumer_id String, required

The insights_consumer_id parameter identifies the consumer whose transactions are used to generate the report.

insights_account_ids String[], optional

The list of accounts, identified by the insights_account_id, which will filter all transactions from the consumer to only those accounts. If missing, all accounts of the insights_consumer_id will be used to generate the report(s). The insights_account_ids parameter must be empty if the excluded_insights_account_ids parameter is set.

excluded_insights_account_ids String[], optional

The list of insights_account_ids which will be excluded from the report generation. The excluded_insights_account_ids parameter must be empty if the insights_account_ids parameter is set.

report_days Integer, optional

This parameter offers to provide a timeframe without need to calculate dates. If the report_days property is set, the parameters from_date and to_date will be derived from current day (today) minus the given number of days. The timeframe for which the report should be generated can be set by specifying either the from_date and to_date parameters or this report_days parameter. If no timeframe is specified, the default timeframe of the last 62 days will be used.

from_date Date (String: "YYYY-MM-DD"), optional

The from_date parameter (in combination with the to_date parameter) will be used as the inclusive start date for this timeframe.

The timeframe for which the report should be generated can be set by specifying either the from_date and to_date parameters or the report_days parameter. If no timeframe is specified, the default timeframe of the last 62 days will be used.

to_date Date (String: "YYYY-MM-DD"), optional

The to_date parameter (in combination with the from_date parameter) will be used as the inclusive end date for this timeframe.

The timeframe for which the report should be generated can be set by specifying either the from_date and to_date parameters or the report_days parameter. If no timeframe is specified, the default timeframe of the last 62 days will be used.

Response Structure of Balance Over Time Report

{
    "data": {
        "reports": Array<BalanceOverTime>
    }
}

data.reports BalanceOverTime[], always present

The list of reports generated depending on the requested parameters.

BalanceOverTime

{
    "type": "BALANCE_OVER_TIME",
    "insights_consumer_id": String,
    "insights_account_ids": Array<String>,
    "balances": Array<BalanceInfo>,
    "from_date": Date,
    "to_date": Date,
    "refreshed_at": DateTime
}

type String, always present

The type always contains the value "BALANCE_OVER_TIME" for this report.

insights_consumer_id String, always present

The insights_consumer_id is the consumer identifier for the account(s) used in this report.

insights_account_ids String, always present

The insights_account_ids is used to identify a specific account within Account Insights. Depending on type of report and requested account-settings this could be a list of ids.

balances BalanceInfo[], always present

List of balances for the account for each date in the given report-timeframe.

from_date Date (String: "YYYY-MM-DD"), always present

The starting date used to generate this report.

to_date Date (String: "YYYY-MM-DD"), always present

The end date used to generate this report.

refreshed_at DateTime (String: "YYYY-MM-DDThh:mm:ss.sssZ), always present

The refreshed_at shows when the data for this account were last refreshed.

BalanceInfo

{
    "date": Date,
    "balance": Amount
}

date Date (String: "YYYY-MM-DD"), always present

The date of the balance.

balance Amount, always present

The current account balance at the time of the date parameter.

Example request

{
    "insights_consumer_id": "6c03aff-8fa0046-ffae74-b0cbc-4d5fd1",
    "report_days": 3,
    "reports": [
        {
            "type": "BALANCE_OVER_TIME"
        }
    ]
}

Example response

{
    "data": {
        "reports": [
            {
                "type": "BALANCE_OVER_TIME",
                "insights_consumer_id": "3b3d678f-66b7-4b23-a2a5-0bfd275e86a1",
                "insights_account_ids": [
                    "3b3d678f-66b7-4b23-a2a5-0bfd275e86a1"
                ],
                "balances" : 
                    [
                        {
                            "date": "2020-10-18",
                            "balance": 
                            {
                                "amount": 15400,
                                "currency": "EUR"
                            }
                        },
                        {
                            "date": "2020-10-19",
                            "balance": 
                            {
                                "amount": 12137,
                                "currency": "EUR"
                            }
                        },
                        {
                            "date": "2020-10-20",
                            "balance": 
                            {
                                "amount": 169758,
                                "currency": "EUR"
                            }
                        }
                    ],
                "refreshed_at": "2021-06-15T09:22:02.523Z"
            }
        ]
    }
}

results matching ""

    No results matching ""