DEV Community

Subhendu Das
Subhendu Das

Posted on

GST Reconciliation Software: AI‑Powered Invoice Matching

Problem

For Indian SMBs and accounting practices, the day‑to‑day task of reconciling purchase invoices against the GSTR‑2B file is tedious, error‑prone and time‑consuming. A single missed invoice can hide a tax‑credit loss, while duplicate entries can trigger compliance flags. Traditional solutions often require manual entry of invoice data or expensive SaaS tiers that do not scale with a growing book of accounts. The result is a backlog of unmatched invoices, potential ITC leakage, and a heavy administrative load on accountants and CA practices.

Feature Overview

GSTBot’s auto‑reconciliation engine tackles this pain point by ingesting invoices in multiple formats—photo, PDF or Excel—extracting the essential fields (vendor GSTIN, invoice number, amount, tax rate, HSN code) through OCR and structured parsing, and then matching each record against the GSTR‑2B file that the tax department publishes every 15th of the month. The core of this feature is a deterministic algorithm that compares invoice totals, tax amounts, and GSTINs, flags mismatches, and surfaces missing or duplicated entries for review.

Data Ingestion and Extraction

When an invoice is uploaded, the system routes the file to a Celery worker that runs a Tesseract OCR pipeline. Tesseract converts the image or PDF into a text blob, which is then parsed by a custom extractor built in Python. The extractor normalises vendor GSTINs, cleans up invoice numbers, and verifies that the tax rate matches the HSN code using a reference table stored in PostgreSQL. If the OCR confidence falls below a threshold, the worker queues a manual review task.

GSTR‑2B Matching

Once the invoice data is normalised, the worker queries the latest GSTR‑2B snapshot stored in a Redis cache for rapid look‑ups. The algorithm performs a multi‑key join on GSTIN, invoice number and total amount. If an exact match is found, the invoice is marked as reconciled. If only the GSTIN and total match but the invoice number differs, the system flags a potential duplicate. If no match is found, the invoice is flagged as missing from GSTR‑2B.

The matching logic also incorporates a “defaulting suppliers” rule: if a supplier’s GSTIN appears in the GSTR‑2B but the invoice number is absent, the system automatically flags the supplier as defaulted for that period, prompting the user to verify the supplier’s filing status.

ITC Calculation and Reversal Flags

After reconciliation, GSTBot calculates the eligible Input Tax Credit (ITC) by applying Rule 37, 42 and 43 checks. It cross‑references the matched invoice totals against the supplier’s GSTR‑1 filings to confirm that the tax paid is indeed recoverable. Any discrepancy triggers a reversal flag that is displayed in the user interface, allowing the accountant to take corrective action before filing GSTR‑3B.

User Experience

The front end, built with React and Vite, presents a clean comparison dashboard. Users can filter by period, supplier, or status (reconciled, missing, duplicate). Each invoice row shows the extracted fields, the matched GSTR‑2B line, and a status badge. Clicking a row opens a modal with a side‑by‑side view of the original invoice image and the GSTR‑2B entry, facilitating quick verification. A bulk action button allows users to export the reconciliation report as JSON or CSV in GST‑portal‑compatible format, ready for GSTR‑1 and GSTR‑3B filing.

Technical Backbone

  • FastAPI serves the REST endpoints for file upload, status polling, and report generation, ensuring low latency and asynchronous handling.
  • PostgreSQL stores invoice metadata, supplier references, and audit logs.
  • Redis caches the latest GSTR‑2B snapshot for fast lookup.
  • Celery orchestrates background OCR and reconciliation tasks, providing scalability for high‑volume users.
  • OpenRouter powers the AI component that refines OCR output and predicts missing fields when the visual data is ambiguous.

The project follows a modular architecture, which makes it straightforward to add new compliance rules or integrate with other tax portals.

Impact on the User

By automating the tedious matching process, GSTBot reduces manual effort by up to 80 % for SMBs that process 100–200 invoices per month. Accountants no longer need to cross‑check each line in the GSTR‑2B file; the system surfaces only the exceptions that require human judgment. The automatic ITC calculation and reversal flags help prevent ITC leakage, ensuring that businesses recover the tax they are entitled to.

The result is a smoother, faster reconciliation workflow that frees up time for strategic financial planning rather than clerical work.

Continuous Improvement

Recent commits (see the GitHub log) have added comparison pages, SEO enhancements, and improved observability. Security headers now guard against header injection, and OAuth flows enforce email verification. These updates reinforce the reliability and trustworthiness of the reconciliation process.

GSTBot is available at https://gstbot.aiknol.com and the source code is hosted on GitHub (https://github.com/r2st/GSTBot). It is built specifically for Indian SMB owners, accountants, and CA practices that find ClearTax Pro and Taxilla priced out of reach.

Conclusion

GSTBot’s auto‑reconciliation feature transforms the way Indian businesses handle GST compliance. By marrying OCR, AI, and rule‑based logic, it delivers accurate, audit‑ready reconciliation that protects against ITC leakage and saves valuable time for finance teams.

Top comments (0)