Balance Prediction Report

This report uses extracted user data to predict future balances for a given timeframe.

URL and Request Body Structure of a Balance Prediction Report

POST /insights/v1/reports/balance-prediction/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 data 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 not defined, 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 can be used to define the reports timeframe without the 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) as from_date and the current day plus the given number of days as to_date. 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 the reports 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 the reports 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 Prediction Report

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

data.reports BalancePrediction[], always present

The list of reports generated depending on the requested parameters.

BalancePredictionReport

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

type String, always present

The type always contains the value "BALANCE_PREDICTION" 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 BalancePrediction[], always present

List of balance predictions 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.

BalancePrediction

{
    "date": Date,
    "prediction": Amount,
    "prediction_range": BalancePredictionRange
}

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

The date of the balance.

prediction Amount, always present

The predicted, average balance of the account at the time of the date parameter.

prediction_range BalancePredictionRange, always present

The default prediction range of the balance defined by an upper and lower bound that specify the expected balance range for this account at the time of the date parameter.

BalancePredictionRange

{
    "upper_bound": Amount,
    "lower_bound": Amount
}

upper_bound Amount, always present

The upper bound amount of this range.

lower_bound Amount, always present

The lower bound amount of this range.

Example request

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

Example response

{
    "data": {
        "reports": [
            {
                "type": "BALANCE_PREDICTION",
                "insights_consumer_id": "3b3d678f-66b7-4b23-a2a5-0bfd275e86a1",
                "insights_account_ids": [
                    "3b3d678f-66b7-4b23-a2a5-0bfd275e86a3"
                ],
                "balances" : 
                    [
                        {
                            "date": "2020-10-18",
                            "prediction": {
                                "amount": 15400,
                                "currency": "EUR"
                            },
                            "prediction_range": {
                                "upper_bound": {
                                    "amount": 16000,
                                    "currency": "EUR"
                                },
                                "lower_bound": {
                                    "amount": 15000,
                                    "currency": "EUR"
                                },
                            }
                        },
                        {
                            "date": "2020-10-19",
                            "prediction": {
                                "amount": 15600,
                                "currency": "EUR"
                            },
                            "prediction_range": {
                                "upper_bound": {
                                    "amount": 16200,
                                    "currency": "EUR"
                                },
                                "lower_bound": {
                                    "amount": 15200,
                                    "currency": "EUR"
                                },
                            }
                        },
                        {
                            "date": "2020-10-20",
                            "prediction": {
                                "amount": 15800,
                                "currency": "EUR"
                            },
                            "prediction_range": {
                                "upper_bound": {
                                    "amount": 16400,
                                    "currency": "EUR"
                                },
                                "lower_bound": {
                                    "amount": 15400,
                                    "currency": "EUR"
                                },
                            }
                        }
                    ],
                "refreshed_at": "2021-06-15T09:22:02.523Z"
            }
        ]
    }
}

results matching ""

    No results matching ""