How to use Lean's Categorisation

The categorisation product provides a category for each transaction that you retrieve from your customer's bank account. The list of categories are the following:

CategoryDescription
BANK_FEES_AND_CHARGESTransactions relating to bank fees and charges
CHARITYTransactions relating to charitable causes
EDUCATIONTransactions relating to education, e.g.: school, university, courses
ENTERTAINMENTTransactions relating to entertainment, e.g.: cinema, Netflix
GOVERNMENTTransactions relating to government, e.g.: taxes, fines
GROCERIESTransactions relating to food shopping
HEALTH_AND_WELLBEINGTransactions relating to health, e.g.: prescriptions, wellbeing, yoga
LOANS_AND_INVESTMENTTransactions relating to loans and investments, e.g.: dividends, loan repayments
RENT_AND_SERVICESTransactions relating to household utilities and rent
RESTAURANTS_DININGTransactions relating to dining and takeaways
RETAILTransactions relating to shopping
SALARY_AND_REVENUETransactions relating to income sources
TRANSFERTransactions relating to direct money movements, e.g.: transfers, cash withdrawals
TRANSPORTTransactions relating to domestic travel, e.g.: metro, cabs
TRAVELTransactions relating to international travel, e.g.: hotels, flights
OTHERTransactions which could not be accurately classified

How to use it

The categorisation product is NOT a separate API. You can retrieve the categories for the transactions for your customer's by making an API request to the Get Transactions API with insights=true. This will return an object that contains a cleansed description, the category and the category confidence (i.e.: how certain Lean is that the transaction belongs to that category).

{
    "status": "OK",
    "results_id": "7cc5db4f-6a74-44ad-85f0-bc86b4608b2f",
    "message": "Data successfully retrieved",
    "meta": null,
    "timestamp": "2025-12-29T14:24:17.488050209Z",
    "status_detail": null,
    "data": {
        "transactions": [
            {
                "entity_id": "d1b13519-ad7b-46a8-bf32-1f9bd97a3dec",
                "account_id": "1f11ff53-04ba-4911-8adf-1769029460b7",
              	"transaction_id": "402cc78a-9df0-4a5b-be13-18efd3cbd5b9",
								.... additional transaction fields 
                "insights": {
                    "description_cleansed": "LOCAL TRANSFER MERU LABS FZE",
                    "category": "TRANSFER",
                    "category_confidence": 0.94
                },
  
            }]
    }
}