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 out of the box.

Income and Expenses API

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 API 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.

Using the APIs

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 fetch the salary 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 API reference
  • Expenses API, please refer to our API reference

📘

We recommend you use the APIs in asynchronous mode to avoid timeouts. To do this, please add the query parameter async=true in your request.

Important information

Income

  • The income 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 AED to accounts denominated in AED 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 AED to accounts denominated in AED are supported