DEV Community

Subhendu Das
Subhendu Das

Posted on

GSTR-2B Matching That Stops ITC Leakage Before Filing

The problem: reconciliation happens too late

Most Indian SMBs discover purchase-register mismatches only after the GSTR-3B deadline — when the portal has already accepted a return that over-claims or under-claims Input Tax Credit. By then, the options are limited: file a correction next month (with interest), absorb the loss, or face a scrutiny notice. The root cause is simple: GSTR-2B is a static snapshot, while the purchase register is a living document. Invoices arrive late, vendors amend returns, and HSN codes get entered inconsistently. Manual matching in Excel breaks down the moment you cross a few hundred lines.

How GSTBot closes the gap

GSTBot ingests purchase invoices the way they actually arrive — phone photos of paper bills, PDFs from vendors, bulk Excel uploads from ERPs. An OCR pipeline (Tesseract) extracts vendor GSTIN, invoice number, date, taxable value, tax rate, and HSN code. Each extracted line is written to a PostgreSQL-backed purchase register that stays editable until you lock the period.

A Celery worker then pulls the latest GSTR-2B JSON from the GST portal (via the authenticated API) and runs a deterministic match: GSTIN + invoice number + financial year. The engine flags four classes of exceptions that map directly to ITC risk:

  • Amount mismatch — taxable value or tax in 2B differs from your invoice.
  • Missing in 2B — the invoice exists in your books but the supplier hasn't uploaded it.
  • Duplicate in 2B — the same invoice number appears twice, usually from a vendor amendment.
  • Defaulting supplier — the counterparty's filing status shows overdue returns, triggering Rule 37/42/43 reversal exposure.

Every exception surfaces in a single dashboard with a one-click action: accept the 2B value, keep your value with an audit note, or mark the invoice for vendor follow-up. The supplier reliability score — computed from on-time filing history and amendment frequency — lets you prioritize which vendors to chase first.

What the workflow looks like

  1. Upload — Drag a folder of PDFs or a phone photo batch. The queue shows extraction confidence per field; low-confidence rows highlight for quick review.
  2. Reconcile — Click "Fetch 2B & Match." Within seconds the exception list loads, grouped by type and supplier. Filters let you isolate, say, only missing invoices from suppliers with a reliability score below 60.
  3. Resolve — For each row, choose "Accept 2B," "Keep Mine," or "Send Reminder." The last option drafts a WhatsApp/email template pre-filled with the invoice details and the 2B discrepancy.
  4. ITC computation — Once exceptions are cleared, GSTBot sums eligible ITC across CGST, SGST, IGST, and cess, then applies Rule 37/42/43 logic automatically. The result is a period-wise ITC register you can export or push straight into the GSTR-3B pre-fill.
  5. Pre-fill & file — Export GSTR-1 and GSTR-3B JSON/CSV that match the portal's schema exactly — no reformatting step required.

Why it changes the filing rhythm

Because reconciliation runs against the live 2B before you file, the ITC number in your GSTR-3B is already vetted. No post-filing surprises, no interest on delayed corrections, no scrambling for vendor acknowledgements at month-end. The same engine also feeds the GSTR-9 annual return checklist and the late-fee calculator added in the latest release, so the work you do once carries forward.

For CA practices managing multiple GSTINs, each client gets an isolated workspace with role-based access — the accountant sees the exception queue, the partner sees the ITC summary and reversal exposure. No data crosses tenants.

Built on stack that stays out of the way

FastAPI serves the API and background jobs; React + Vite delivers a responsive single-page app that works offline as a PWA (installable on mobile). Redis caches 2B pulls so repeated reconciliation runs don't hit portal rate limits. OpenRouter provides the LLM layer for invoice-field normalization when OCR confidence is low. Everything runs in containers; the repository includes Docker Compose for self-hosting or the hosted version at gstbot.aiknol.com.

Bottom line

GSTR-2B matching stops being a month-end fire drill and becomes a continuous check you can run any day. The ITC you claim is the ITC you can defend — because every deviation was reviewed, resolved, or documented before the return went out.

Top comments (0)