Back to Blog

How SpendSights categorize (UPI) transactions automatically?

Understanding bank statements

Bank statements is the best place to get an overview of our spending, all the Indian banks usually have few columns (transaction date, description, amount debited, amount credited and closing balance) for each transaction along with account holder and branch details in the top.

We can read them manually with some effort but when we want to do this every month and for a large data it gets tedious or impossible. And you know what, it’s not that easy to write a straight forward algorithm to automate this process. Each bank has it’s own format, which we can make the machine to understand but the transaction’s description in the statement file makes the process harder.

Transaction Description

Description, termed differently in each bank (eg: it’s called ‘narration’ in the HDFC), contains the important portion of the transaction but it’s highly unstructured. As there is no defined structure followed by all the banks in India, they are free to form it in any way they like.

(Possible) Info in each description:

  • It has a code for the transaction type, i.e: whether it’s an online bank transfer, UPI, ATM withdrawals, etc.,
  • Merchants name will get added sometimes, eg: you can see ‘Indian Oil’, ‘Swiggy’, ‘Zerodha’ based on the transaction.
  • If it’s a UPI transaction then it will have it’s VPA (Virtual payment address) and the comment we provide while making the UPI payment.

Categorizing UPI transactions

Since we can’t get much details about the transaction from the UPI ID, we built an in-house workflow to categorize them.


Each transaction will be assigned to a category. We extended the categories to have it’s own tags. Example: For the ‘food’ category, you can add ‘breakfast’, ‘Office canteen’ or any other appropriate ‘tags’.

We expect users to add any of these tags in their UPI payments as a comment while making the payment and our categorization engine will identify these
from the transaction’s description and label them to the a ‘category’.

We are also working on extending our existing Merchants model to have their own UPI ID, so that they can reused during future categorizations.

Category Tags