Similar Transactions Report

This endpoint allows you to find transactions similar to one that is specified in the request.

URL and Request Body Structure of an Similar Transactions Report

POST /insights/v1/reports/similar-transactions/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>,
    "required_data_availability": ?Enum<'COMPLETE', 'PARTIAL', 'NONE'>,
    "combine_accounts": ?Enum<'NONE', 'ALL'>
    "from_date": ?Date,
    "to_date": ?Date, 
    "report_days": ?Integer,
    "source_insights_account_id": String,
    "source_insights_transaction_id": String,
    "size": ?Integer,
    "minimum_score": ?Integer,
    "include_user_changed": ?Boolean,
    "order": ?Array<ReportOptionsOrderBy>,
    "match_transaction_type": ?Boolean
}

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.

source_insights_account_id String, required

The source_insights_account_id and source_insights_transaction_id are used in combination to select the transaction for which similar transactions should be searched

source_insights_transaction_id String, required

The source_insights_account_id and source_insights_transaction_id are used in combination to select the transaction for which similar transactions should be searched

size Integer, optional

Only return a maximum of size transactions in the report. The default will be 10.

minimum_score Integer, optional

Filters out transactions in the response that have a similarity score less than the given minimum_score.

include_user_changed Boolean, optional

Defines if the returned similar transactions should include transactions where the category was already changed via the client/customer. Default is false.

match_transaction_type Boolean, optional

Specifies whether the returned similar transactions should be matched to the same type as the source transaction. Default is false.

order ReportOptionsOrderBy[], optional

Use this parameter to return the transactions in a specific order.

ReportOptionsOrderBy

{
    "order": ?Enum<'ASC', 'DESC'>,
    "field": Enum<'AMOUNT','DATE','CATEGORY','BRAND','AMOUNT_WITH_TYPE'>
}

Response Structure of Similar Transactions Report

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

data.reports AccountInfo, always present

The list of reports generated depending on the requested parameters.

SimilarTransactionsReport

{
    "type": "SIMILAR_TRANSACTIONS",
    "insights_consumer_id": String,
    "insights_account_ids": Array<String>,
    "from_date": Date,
    "to_date": Date,
    "refreshed_at": DateTime,
    "data_availability": Enum<'COMPLETE', 'PARTIAL', 'NONE'>,
    "transactions": Array<SimilarTransaction>
}

type String, always present

The type always contains the value "SIMILAR_TRANSACTIONS" 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.

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.

data_availability Enum, always present

The availability of transaction data for the requested timeframe.

  • COMPLETE - data for the whole timeframe was available
  • PARTIAL - some data in the timeframe was available
  • NONE - no data in the timeframe was available

transactions SimilarTransaction[], always present

The similar transactions.

SimilarTransaction

{
    "score": Integer,
    "transaction": 
}

score Integer, always present

A score between 1 and 100 that shows the similarity of the transaction to the defined transaction. 1 is the worst similarity, 100 the best similarity.

transactions CategorizedTransaction[], always present

The transaction details for this transaction.

Example request

{
    "insights_consumer_id": "6c03aff-8fa0046-ffae74-b0cbc-4d5fd1",
    "source_insights_account_id": "10c472b1-5c82-41bb-882e-647650055a74",
    "source_insights_transaction_id": "e8d35eee-9f74-473d-ae04-e7bc404df47c",
    "size": 5,
    "minimum_score": 70
}

Example response

{
    "data": {
        "reports": [
            {
                "type": "SIMILAR_TRANSACTIONS",
                "insights_consumer_id": "10c472b1-5c82-41bb-882e-647650055a74",
                "insights_account_ids": [
                    "3b3d678f-66b7-4b23-a2a5-0bfd275e86a1",
                    "e8d35eee-9f74-473d-ae04-e7bc404df47c"
                ],
                "transactions": [
                    {
                        "score": 87,
                        "transaction": {
                            "ob_transaction_id": "31234-12314234",
                            "insights_account_id": "e8d35eee-9f74-473d-ae04-e7bc404df47c",
                            "booking_date": "2020-01-01",
                            "amount": {
                                "amount": 1599,
                                "currency": "EUR"
                            },
                            "reference": "lidl sagt danke",
                            "type": "DEBIT",
                            "method": "UNKNOWN",
                            "categories": [
                                {
                                    "id": "a9184d59-25be-5f03-aebb-f639a5ed9a8a",
                                    "name": "Groceries"
                                }
                            ],
                            "brand": {
                                "id": "664bb3a2-62c9-52b7-9ccd-81cfe904258c",
                                "name": "LIDL"
                            },
                            "insights_transaction_id": "ae66102e-f4ff-5e02-8f95-ad0bbd225e19"
                        }
                    },
                    {
                        "score": 88,
                        "transaction": {
                            "insights_account_id": "3b3d678f-66b7-4b23-a2a5-0bfd275e86a1",
                            "value_date": "2020-01-01",
                            "amount": {
                                "amount": 679,
                                "currency": "EUR"
                            },
                            "reference": "rewe sagt danke",
                            "type": "DEBIT",
                            "method": "TRANSFER",
                            "state": "PROCESSED",
                            "categories": [
                                {
                                    "id": "edde5df6-fbf4-5e79-afb1-97de52d93aca",
                                    "name": "Groceries"
                                }
                            ],
                            "brand": {
                                "id": "71569e21-bfe3-5871-9a5a-f791cca811c0",
                                "name": "Rewe"
                            },
                            "insights_transaction_id": "3a1cf972-a9bb-5fc7-b36d-12ad707f29aa"
                        }
                    }
                ],
                "refreshed_at": "2021-06-15T09:22:02.523Z",
                "from_date": "2021-05-21",
                "to_date": "2021-06-14",
                "data_availability": "PARTIAL"
            }
        ]
    }
}

results matching ""

    No results matching ""