Generating an e-invoice requires strict alignment between your accounting master data and the schema validation rules of the Invoice Registration Portal. When an accounts team creates an outward bill and clicks upload, the IRP pre-validates every single line item before computing the 64-character Invoice Reference Number (IRN) hash. If an item carries an incomplete or incorrect Harmonised System of Nomenclature (HSN) code, the system halts with an error stating that the HSN code is not as per aggregate turnover rules.
In practice, accountants using various ERP connectors and middleware tools find this rejection mapped as error 2265 or item-level error 2176 (HSN code(s) is invalid). While official portal error lists also reserve 2265 for recipient state code validations, billing platforms widely bundle HSN turnover mismatch exceptions into this category. The legal root cause remains identical across all systems: your company aggregate turnover mandates 6-digit or 8-digit reporting, but your billing voucher submitted a 2-digit chapter heading, an unmapped 4-digit code, or an inactive entry.
Statutory mandate under Notification 78/2020 and Rule 46(g)
The requirement to declare specific digit lengths for HSN codes is governed by the first proviso to Rule 46(g) of the CGST Rules, 2017. Under this provision, the Central Board of Indirect Taxes and Customs (CBIC) issued Notification No. 78/2020-Central Tax dated 15 October 2020, establishing mandatory HSN digit standards based on Aggregate Annual Turnover (AATO):
| Aggregate Annual Turnover (AATO) | Minimum digits for B2B supplies | Minimum digits for B2C supplies | Statutory rule reference |
|---|---|---|---|
| Up to Rs 5 Crore | 4 digits | Optional (4 digits permitted) | Rule 46(g), Table Entry 1 |
| Above Rs 5 Crore | 6 digits (mandatory) | 6 digits (mandatory) | Rule 46(g), Table Entry 2 |
| All taxpayers: Export of goods | 8 digits (mandatory) | Not applicable | Customs tariff alignment |
| Chemical and specific notified sectors | 8 digits (mandatory) | 8 digits (mandatory) | Notified 49 chemical items |
Because e-invoicing under Rule 48(4) of the CGST Rules applies to registered persons whose aggregate turnover in any preceding financial year from 2017-18 onwards exceeds Rs 5 Crore, virtually every taxpayer generating an e-invoice is legally classified under the second category. Therefore, submitting a 4-digit code on an e-invoice payload is a direct violation of both Rule 46(g) and the IRP validation rules.
Guidance published on the NIC e-invoice portal (einvoice1.gst.gov.in) confirms that line items are cross-referenced in real time against the central HSN master database. If the digits passed do not match a valid 6-digit or 8-digit tariff entry, the portal issues code 2176 or 2265 and rejects the document payload.
Notice risk: An invoice issued without a valid IRN is deemed completely invalid under Rule 48(5). If your billing operator bypasses the API error and sends a plain invoice copy to the buyer, the buyer will be denied input tax credit under Section 16(2)(aa) because the transaction never auto-populates into Form GSTR-2B.
Why obsolete 8-digit and 4-digit codes fail on the IRP
In our tool checks and user audits, many businesses assume that an 8-digit code copied from an old purchase order or legacy excise master is always safe. However, on the portal, the GST system and the e-invoice engine enforce three structural checks on HSN inputs:
- The 6-digit minimum barrier: For any entity whose turnover exceeds Rs 5 Crore, the JSON attribute HsnCd must contain at least 6 numeric characters. If an operator enters chapter-level numbers like 84 or heading-level numbers like 8481, the portal schema validation engine rejects the submission immediately.
- Deprecated tariff codes: India aligned its Customs Tariff with the World Customs Organization (WCO) Harmonized System revisions. Dozens of 8-digit tariff lines were renumbered, merged, or deleted. If your item master contains a discontinued 8-digit code, the IRP flags it as invalid against the active directory, returning error 2176.
- Export transaction rules: For export invoices (document type INV with supply type EXPWP or EXPWOP), customs regulations require complete 8-digit tariff classification. Passing a 6-digit code on an export payload causes rejection or leads to automated customs gateway (ICEGATE) transmission failures.
Step-by-step resolution for error 2265 in your ERP
Unlike duplicate invoice errors where an IRN is already registered and cancelled, an HSN mismatch error occurs prior to IRN creation. The document number is not consumed. You do not need to void the invoice series or create a credit note. Follow these four steps to resolve the mismatch:
Step 1: Identify the exact offending line item
In multi-item invoices, the IRP response payload includes the specific line number that failed validation. Review the API response JSON or your ERP error log to see which item triggered the flag. In third-party software, look for the field tag ItemList[n].HsnCd.
Step 2: Cross-check the HSN on the official portal
Open the official e-invoice portal (einvoice1.gst.gov.in). Navigate to Search and select Master Codes, then click HSN. Alternatively, use the search tool on the GST common portal (tutorial.gst.gov.in). Enter the first 4 or 6 digits of your product description to locate the active 6-digit and 8-digit tariff codes recognized by the government system.
Step 3: Update item master records in your software
Do not simply edit the invoice screen. If you only modify the current voucher, future invoices for the same product will fail again. We recommend opening your accounting system and updating the central master:
- In Tally Prime, go to Gateway of Tally → Alter → Stock Item → Select Item → Set/Alter GST Details → Update HSN/SAC to the valid 6-digit code.
- In Zoho Books, open Items → Select Item → Edit → Enter 6-digit HSN in the HSN/SAC field → Save.
- In SAP or ERP systems, update the Material Master control data in transaction code MM02 under the Foreign Trade / Export and Plant Data views.
Step 4: Re-upload the voucher to generate the IRN
Return to the pending invoice in your software. Refresh the tax and item calculation to pull the updated master code. Click Generate E-Invoice or re-send the payload via your GSP connection. The IRP will validate the 6-digit code, generate the 64-character IRN hash, sign the document, and return the official QR code.
A common mistake: Padding 4-digit codes with trailing zeroes, such as turning 8481 into 848100. Unless 848100 exists as an active 6-digit sub-heading in the official Customs Tariff, the portal validates it as a non-existent code and rejects the bill again.
Worked example of resolving an HSN length mismatch
For example, consider Kaveri Industrial Valves Pvt Ltd (turnover Rs 18 Crore), which sells specialized steel check valves to a registered buyer in Bengaluru on 19 October 2026. The billing operator creates invoice KIV/26-27/0412 with two items. Line 1 uses a legacy 4-digit code, while Line 2 uses an updated 6-digit code.
| Item description | HSN submitted | Taxable value | Initial IRP status | Corrected HSN code | Final result |
|---|---|---|---|---|---|
| Cast iron gate valves | 8481 (4 digits) | ₹1,20,000 | Rejected: Error 2265 / 2176 | 848180 (6 digits) | IRN generated |
| Hydraulic actuator kits | 841221 (6 digits) | ₹80,000 | Pre-check passed | 841221 (unchanged) | IRN generated |
| Invoice total | Mixed | ₹2,00,000 | Whole payload rejected | Compliant master | IRN: 3f8a...4b12 |
Because the supplier aggregate turnover exceeds Rs 5 Crore, the entire invoice payload of ₹2,00,000 plus 18% GST (₹36,000) was rejected by the portal due to Line 1. The accountant did not alter the invoice number. Instead, the accountant updated the item master for cast iron gate valves to 6-digit code 848180. Upon resubmission, invoice KIV/26-27/0412 was successfully registered without needing any credit note or document cancellation.
Impact on Form GSTR-1 Table 12 and recipient GSTR-2B
HSN compliance extends directly from the e-invoice engine into monthly return reporting. Under GST return filing architecture:
- Form GSTR-1 Table 12 sync: When an e-invoice is registered, the IRP auto-populates the outward supply details into Form GSTR-1 Table 4A (B2B invoices) and feeds the corresponding line items into Table 12 (HSN-wise summary of outward supplies). From May 2025 onwards, GSTN mandates separate reporting for HSN B2B and HSN B2C tables, with strict dropdown validation. Resolving e-invoice errors ensures Table 12 auto-populates without manual data re-entry.
- GSTR-2B matching for the recipient: Recipient accountants matching their purchase registers against GSTR-2B between the 14th and 20th rely entirely on successful supplier IRN generation. If a supplier fails to resolve error 2265 and dispatches goods under a physical printout with no IRN, that document will never appear in the buyer GSTR-2B. Under Section 16(2)(aa), the buyer cannot take credit, creating payment disputes and vendor reconciliation holds.
To prevent similar billing interruptions, examine our guide on e-invoice error 2283 recipient GSTIN inactive to handle buyer registration suspensions. If your accounts team accidentally attempts to regenerate an IRN after voiding a voucher, read our practical analysis of e-invoice error 2278 duplicate IRN on cancelled document. For questions regarding company turnover thresholds, see our reference on e-invoice exempted goods turnover threshold. If adjusting outward credit values, review our step-by-step workflow on e-invoice B2B credit note IRN generation.
Related guides
- E-invoice signature verification and digital signature error fix
- How to fix excel to json error in GSTR-1 offline tool: troubleshooting guide
- B2C dynamic QR code compliance: threshold rules, exemption scope, and UPI payment reconciliation under GST
- GSTR-2B tax amount mismatch: why the tax differs and how to fix it
- GSTR-2B Table 4D mismatch: unmatched invoices and fixes
Frequently asked questions
Why does the e-invoice portal reject an invoice with error 2265 or HSN digit mismatch?
The Invoice Registration Portal validates every line item HSN against statutory aggregate turnover thresholds notified under Rule 46(g). Taxpayers with annual aggregate turnover above Rs 5 Crore must declare at least 6-digit HSN codes for all B2B supplies. Submitting 2-digit or 4-digit codes triggers an immediate schema validation failure.
How many HSN digits are required for export e-invoices?
Export transactions require a full 8-digit HSN code for goods and a 6-digit SAC code for services. The customs and foreign trade classification requires tariff-level 8-digit precision on all shipping documents and e-invoices generated under document type INV with export flags.
Do businesses need to cancel an invoice voucher in their accounting software after an HSN rejection?
No. When the IRP rejects an e-invoice payload at the pre-validation or schema stage, no Invoice Reference Number (IRN) is generated. You do not need to cancel the document or issue a new serial number. Simply correct the item master to a valid 6-digit or 8-digit HSN code and re-upload the same document number.
What is the difference between official NIC error 2265 and item error 2176?
On the official NIC error master, error 2265 relates to state code mismatches between the recipient GSTIN and recipient details, but ERP connectors frequently label HSN aggregate turnover rule rejections under 2265. Direct invalid code errors return code 2176 stating HSN code is invalid. Both require item master verification against the central GST tariff directory.
How does an HSN validation failure affect buyer input tax credit in GSTR-2B?
If an e-invoice payload is blocked due to an HSN error, no IRN is generated and the invoice fails to auto-populate into the supplier GSTR-1 and the recipient GSTR-2B. Under Section 16(2)(aa) and Rule 48(5), an invoice without an IRN is invalid and the buyer cannot claim input tax credit.
Check your own GSTR-2B
Match your purchase register against Form GSTR-2B in seconds. Your GSTR-2B and purchase register files are read in your browser and never uploaded to any server.
Last checked: 19 October 2026. Sources: CBIC Notification 78/2020-CT, CGST Rule 46, NIC E-Invoice Portal Error Master, GSTN Form GSTR-1 User Manual.