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
}
The insights_consumer_id
parameter identifies the consumer whose transactions are used to generate the report.
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.
The list of insights_account_id
s 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.
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.
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.
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.
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
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
Only return a maximum of size
transactions in the report. The default will be 10.
Filters out transactions in the response that have a similarity score less than the given minimum_score
.
Defines if the returned similar transactions should include transactions where the category was already changed via the client/customer. Default is false.
Specifies whether the returned similar transactions should be matched to the same type as the source transaction. Default is false.
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>
}
}
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>
}
The type
always contains the value "SIMILAR_TRANSACTIONS" for this report.
The insights_consumer_id
is the consumer identifier for the account(s) used in this report.
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.
The starting date used to generate this report.
The refreshed_at
shows when the data for this account were last refreshed.
The availability of transaction data for the requested timeframe.
COMPLETE
- data for the whole timeframe was availablePARTIAL
- some data in the timeframe was availableNONE
- no data in the timeframe was available
The similar transactions.
SimilarTransaction
{
"score": Integer,
"transaction":
}
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.
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"
}
]
}
}