Schedule icon
Write icon
Queries icon
If icon
Log icon
SlackIncomingWebhook icon

Reconcile Your Purchase Register with GSTR-2B Before Claiming Input Tax Credit

Match your purchase register to GSTR-2B every month. Catch missing invoices, value and tax head mismatches, blocked ITC and duplicates before GSTR-3B.

Categories
BusinessData

In India, input tax credit can only be claimed for invoices that appear in GSTR-2B, the statement the GST portal builds from what your suppliers report. Every month, finance teams compare their purchase register with GSTR-2B by hand: invoice numbers are written differently on each side, some suppliers report late or with the wrong values, and some invoices in GSTR-2B were never booked. Claiming credit that is not in GSTR-2B leads to notices, interest and reversals. This blueprint does the matching automatically, shows how much credit is at risk and why, and lists which suppliers to follow up with before GSTR-3B is filed. Everything runs locally in DuckDB: no GST portal credentials, no GSP API, and no invoice data leaving your Kestra instance.

How it works

  1. sample_purchase_register and sample_gstr2b (io.kestra.plugin.core.storage.Write) write one month of booked invoices and the matching GSTR-2B export, with one example of every problem. They are used only when the matching input is empty, so the flow runs out of the box.

  2. reconcile (io.kestra.plugin.jdbc.duckdb.Queries) loads both CSV files through inputFiles and normalises GSTINs and invoice numbers (upper case, separators removed, leading zeros dropped, so KAF-0042 and KAF/42 match). It matches on supplier GSTIN and invoice number and reports:

    • errors (credit at risk): invoice not in GSTR-2B, ITC marked not available in GSTR-2B, taxable value or tax different beyond tolerance, IGST in one source and CGST+SGST in the other (wrong place of supply), and the same invoice booked twice;
    • warnings: invoice in GSTR-2B but not in your books, invoice number written differently, and invoice date different.

    The per-invoice result is written to itc_reconciliation.csv with outputFiles, and the final SELECT returns the summary through fetchType: FETCH_ONE, available as outputs.reconcile.outputs[0].row.

  3. route_findings (io.kestra.plugin.core.flow.If) logs every error and warning when credit is at risk, and a nested If posts the same findings to Slack when notify_slack is true. A clean month is logged as well.

  4. The errors block logs a failed run loudly and says not to file GSTR-3B from it, because a reconciliation that silently does not run looks the same as a clean month.

  5. The monthly_after_2b Schedule trigger (15th of each month, 09:00 IST, shipped disabled) runs the day after GSTR-2B is generated.

What you get

  • outputs.itc_reconciliation: CSV with status (ERROR, WARNING or OK), entry_id, supplier_gstin, supplier_name, invoice_no_books, invoice_no_2b, taxable_books, taxable_2b, tax_books, tax_2b and issues, errors first.
  • outputs.reconciliation_summary: JSON with invoices_in_books, invoices_in_2b, itc_in_books, itc_matched, itc_at_risk, ok_count, warning_count, error_count, error_details and warning_details.
  • With the sample data: Rs 42,840 of Rs 70,200 credit at risk across 5 errors (an invoice the supplier never reported, ITC marked not available, IGST booked as CGST+SGST, a taxable value of Rs 1,20,000 reported as Rs 1,02,000, and an invoice booked twice), 4 warnings (two invoices in GSTR-2B that were never booked, a date off by one day, and KAF-0042 reported as KAF/42) and 3 clean matches, including a Rs 0.80 rounding difference within the tolerance.

Who it's for

  • Accounts and tax teams in India that reconcile GSTR-2B every month before filing GSTR-3B.
  • Chartered accountants and GST practitioners who run the same reconciliation for many clients.
  • Data teams that load purchase data into a warehouse and want an automated ITC check on top.

Why orchestrate this with Kestra

A spreadsheet can reconcile one month once. Kestra runs it every month on schedule, keeps every month's report in the execution history as evidence for the GSTR-3B, branches on the result and alerts the people who chase suppliers. Because the inputs are plain files, the same flow can be triggered when the GSTR-2B download lands in S3, SFTP or Google Drive, or run once per GSTIN for multi-state businesses with a ForEach.

Prerequisites

  • Nothing for the demo: the sample files are built in.
  • For your own data: the month's purchase register exported from your ERP or Tally, and the GSTR-2B B2B section downloaded from the GST portal (Excel or JSON) and saved as CSV with the columns below.

Inputs

  • purchase_register (FILE, optional): entry_id, supplier_gstin, supplier_name, invoice_no, invoice_date (YYYY-MM-DD), taxable_value, igst, cgst and sgst.
  • gstr2b (FILE, optional): supplier_gstin, trade_name, invoice_no, invoice_date (YYYY-MM-DD), taxable_value, igst, cgst, sgst and itc_available (Y or N).
  • tolerance (FLOAT, default 1): difference in rupees still treated as a match.
  • notify_slack (BOOL, default false): post the findings to Slack when credit is at risk.

Secrets

  • SLACK_WEBHOOK_URL: Slack incoming webhook URL. Only needed when notify_slack is true.

Quick start

  1. Save the flow and run it with the default inputs.
  2. Open the logs of log_errors and download itc_reconciliation from the Outputs tab.
  3. Run it again with your own purchase register and GSTR-2B export.
  4. Optional: add the SLACK_WEBHOOK_URL secret and set notify_slack to true.
  5. Point the inputs at your real sources and set disabled: false on monthly_after_2b.

Common pitfalls

  • This blueprint covers the B2B invoice section of GSTR-2B. Credit notes, debit notes, imports and ISD credit need their own columns or a second run.
  • Invoice numbers are matched after removing separators and leading zeros, so check the warnings: two different invoices can look alike after normalisation in rare cases.
  • Export dates as YYYY-MM-DD. Spreadsheets often save 03/09/2026 in a local format that cannot be read reliably.
  • GSTR-2B is a static statement for the month. An invoice the supplier reports late appears in a later month's GSTR-2B, so keep chasing the errors instead of dropping them.

How to extend

  • Read the purchase register straight from your ERP or warehouse (Postgres, MySQL, BigQuery, Snowflake) and write the report back to a table.
  • Fetch GSTR-2B through your GST Suvidha Provider's API instead of a manual download.
  • Email each supplier with invoices missing from GSTR-2B with a ForEach and an email task.
  • Combine it with the GSTIN vendor master validation blueprint so that wrong GSTINs are fixed before they cause mismatches.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.