Provide Data

This endpoint will store consumer data, which is needed to generate reports later. Most reports need a transaction history to work with. This endpoint must be used in case a report should be generated from sources other than Open banking. by Klarna. Any existing list of transactions can be provided and will be used by the report engine.

URL and Request Body Structure of a Provide Data Call

POST /insights/v1/storage/save HTTP/1.1
Content-Type: application/json; charset=utf-8
Authorization: Token <Token>
Host: <Host>
{
    "insights_consumer_id": ?string,
    "data_retention_minutes": ?int,
    "account": ?ProvidedAccount,
    "transactions": Array<ProvidedTransactions>,
    "from_date": ?string,
    "to_date": ?string,
    "data_refresh_at": ?string
}

insights_consumer_id String, optional

Data provided with this call will be stored with this insights_consumer_id, so later reports can be generated using only data for this consumer. Any string with less than 128 characters can be used to identify the consumer. If left empty, a new identifier will be generated and returned in the response to this call.

data_retention_minutes int, optional

Depending on the use case, it might be helpful to store transactions (maybe consolidate transactions for a single consumer from different sources) for some minutes. With the data_retention_minutes this can be determined. If left empty, the default value of 10 minutes will be used.

account ProvidedAccount, optional

The account parameter limits the report to only include data from this account.

transactions ProvidedTransactions[], required

The list of transactions to be used for report-generation.

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

The from_date property (in combination with the to_date property) marks the start date of the range of provided transactions. It has to be in the YYYY-MM-DD format according to ISO 8601.

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

The to_date property (in combination with the from_date property) marks the end date of the range of provided transactions. It has to be in the YYYY-MM-DD format according to ISO 8601.

data_refresh_at DateTime, optional

With the data_refresh_at property the date and time (like age or as-of) of the provided account & transactions can be set. If left empty the current time will be set. Helpful for back-tracking or comparison of recurring reports. The data_refresh_at property has to be provided with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 2007-12-03T10:15:30+01:00.

Response Structure of ProvideTransactions

{
    "data": {
        "insights_consumer_id" : string,
        "insights_account_id" : string
    }
}

data.insights_consumer_id String, always present

The retrieved data was stored with this insights_consumer_id. It can be used to identify this consumer when generating a report later.

data.insights_account_id String, always present

Since consumers could have multiple accounts, using this insights_account_id makes it possible to identify a specific account when generating any insight report.

results matching ""

    No results matching ""