How to use Data Enrichment APIs
Lean offers a set of products that retrieve the data from the bank and process the data so that you get the metrics and data points that you need. All APIs are independent of each other (i.e.: you do not need to call one of them to call the other).
Income and Expenses API (retail customers only)
Allows you to fetch information about the salary, non-salary income and expenses in a bank account, respectively.
Before using the APIs
Before you use the APIs you will need to ensure that you have an entity_id
with both accounts
and transactions
permissions. You can see how to do this in our guide on creating an entity.
Moreover, access_from
will need to be set to before the start_date
that you want to pass in the salary API request (see API reference). You will need to set access_to
to after the point in time when you will make the request to the salary API (otherwise, by the point you make the request your access will have expired). You can see how to do this in our guide on creating the entity.
Using the API
To use the API, you will have to call the endpoint with the entity_id
you obtained before and a start_date
that determines the start of the time period we will return the salary data for. You also have the option to pass the estimated value of the salary which we will use to provide a more accurate estimate. For more details on:
- Income API, which provides both salary and non-salary income, please refer to our Income API reference
- Expenses API, please refer to our Expenses API reference
Important information
Income
- The salary provided by the API is an estimate based on the identification of certain indicators
- The income provided is identified based on keywords and patterns of recurrency
- Only income credited in SAR to accounts denominated in SAR are supported
- The product is unable to identify salaries if the bank does not provide any indicators
Expenses
- The expenses API relies on keywords and a categorisation machine learning model which have a margin of error
- Only expenses credited in SAR to accounts denominated in SAR are supported
Updated 2 months ago