E-Invoicing Error Codes: NIC Portal IRN Generation Troubleshooting Guide
The definitive technical and statutory guide to debugging and resolving e-invoicing errors on the National Informatics Centre (NIC) Invoice Registration Portal (IRP). Master error codes 2150, 2175, 2182, 2283, JSON schema validation rules, tax rounding tolerances, and 24-hour cancellation protocols.
Direct Answer: Why Does E-Invoice IRN Generation Fail on the NIC Portal?
1. Overview: The NIC Invoice Registration Portal (IRP) Architecture
Under Rule 48(4) of the Central Goods and Services Tax Rules, 2017, all registered businesses whose aggregate turnover in any preceding financial year exceeds ₹5 Crore are statutorily mandated to report B2B, B2G, and export supply invoices to the Invoice Registration Portal (IRP).
The IRP operates as a high-speed cryptographic gateway. It ingests standardized JSON payloads conforming to Schema INV-01, validates mandatory data nodes, checks for duplicates, computes a 64-character SHA-256 hash (the Invoice Reference Number or IRN), signs the payload with NIC's digital certificate, embeds a dynamic QR code, and pushes the data asynchronously to the GSTN Common Portal (for GSTR-1 auto-population) and the National E-Way Bill System.
2. The INV-01 JSON Schema Architecture
The e-invoice payload contains mandatory and optional JSON nodes. A single missing character, incorrect data type, or illegal string character (e.g. forward slashes or special symbols in invoice numbers) results in instant schema rejection before the database query is even executed:
// Key Mandatory Nodes in INV-01 Payload
"DocDtls": { "Typ": "INV", "No": "INV-2026-001", "Dt": "20/10/2026" },
"SellerDtls": { "Gstin": "27AAACB2212M1Z1", "LglNm": "Apex Logistics Ltd", "Pin": 400001, "Stcd": "27" },
"BuyerDtls": { "Gstin": "06AAACT0000A1Z5", "Pos": "06", "Pin": 122001, "Stcd": "06" },
"ItemList": [ { "ItemNo": 1, "HsnCd": "84713010", "Qty": 10, "UnitPrice": 45000, "TotAmt": 450000, "AssAmt": 450000, "GstRt": 18, "IgstAmt": 81000 } ],
"ValDtls": { "AssVal": 450000, "IgstVal": 81000, "TotInvVal": 531000 }
3. Master Classification of NIC Error Codes
Error codes returned by the IRP API are categorized by their numerical prefixes:
Token expired, invalid client ID/secret, IP address not whitelisted in GSP portal, encryption key mismatch.
Duplicate IRN, inactive GSTIN, HSN invalid, state code mismatch, document date older than permissible window.
Vehicle number format incorrect, PIN distance unavailable, transporter ID inactive, transshipment date invalid.
4. Error 2150: "Duplicate IRN, already generated"
The NIC IRP creates a SHA-256 hash using the tuple: Supplier GSTIN + Document Type + Document Number + Financial Year. If an IRN was generated earlier for this exact tuple—even if by another ERP terminal or user—the IRP rejects subsequent requests with Error 2150.
Step-by-Step Resolution Protocol:
1. Do Not Re-Attempt with Modified Dates: Changing the invoice date while keeping the invoice number identical will NOT resolve the duplicate hash.
2. Call the "Get IRN by Details" API: Pass Supplier GSTIN, Doc Type, Doc No, and FY to fetch the signed invoice payload and QR code already on the portal.
3. If Previous Invoice was Cancelled: The GST system permanently burns cancelled invoice numbers. You must generate a brand new invoice with a fresh serial number (e.g., INV-002 instead of INV-001).
5. Error 2175: "Recipient GSTIN is not active"
The IRP validates the recipient's GSTIN against the real-time GSTN registration master. If the recipient has failed to file returns for consecutive tax periods, or if the tax authority initiated suo motu cancellation, the GSTIN status flips to "Suspended" or "Cancelled".
6. Error 2182: "HSN code does not exist in master"
The IRP validates all line-item HSN codes against the official Customs Tariff Act, 1975 master schedule maintained by the NIC.
Common Triggers & Fixes for HSN Rejections:
- Truncated Digits: Submitting a 2-digit or 4-digit HSN code. For entities subject to e-invoicing (turnover > ₹5 Cr), Notification No. 78/2020-Central Tax mandates a minimum of 6 digits for B2B supplies.
- Obsolete HSN Numbers: Tariff revisions frequently merge or delete legacy 6-digit codes. Verify the latest active code using the "Master Codes -> HSN Codes" search on einvoice1.gst.gov.in.
- Services SAC vs Goods HSN: Service Accounting Codes (SAC) must strictly start with prefix 99 (e.g., 998311 for IT consultancy). Using non-99 codes for services results in Error 2182.
7. Error 2283: "Distance between PIN codes is not available"
When generating an integrated E-Way Bill (EWB) simultaneously with the e-invoice by populating the EwbDtls block, the IRP queries the NIC motor distance matrix.
The Fix: In your API payload, set "Distance": 0. When set to zero, the NIC portal automatically calculates the motorable highway distance based on its internal GIS mapping database.
If manual distance is provided, it must not exceed a ±10% deviation from the system's pre-calculated route distance; otherwise, Error 2283 or Error 2284 is thrown.
8. Mathematical & Tax Rounding Errors (Error 2194 / 2197)
The IRP performs rigid mathematical checks on invoice line items before issuing an IRN. The following mathematical identities must hold true:
1. AssVal = Σ (Item AssAmt)
2. CgstVal = Σ (Item CgstAmt) [Must equal SgstVal for intra-state]
3. IgstVal = Σ (Item IgstAmt) [For inter-state]
4. TotInvVal = AssVal + CgstVal + SgstVal + IgstVal + CesVal + OtherChrg - RndOffAmt
The Rounding Tolerance Rule: The IRP permits a maximum round-off variance of ±₹2.00 between the sum of line-item taxes and the declared total invoice value. If rounding adjustments exceed ₹2.00, Error 2197 ("Total invoice value doesn't match sum of items") is triggered.
9. The 24-Hour Cancellation Limit & Credit Note Protocol
Within 24 Hours of Generation
An e-invoice with errors can be cancelled on the IRP via the "Cancel IRN" API or portal within exactly 24 hours of creation, provided no active E-Way Bill is associated with it (cancel EWB first).
Beyond 24 Hours: Section 34 Protocol
After 24 hours, the IRP permanently locks the record. The invoice pushes automatically to GSTR-1. You cannot cancel it on the IRP. You must issue a formal Credit Note (with its own e-invoice IRN) under Section 34 of the CGST Act to nullify the erroneous invoice.
10. Master Troubleshooting Matrix: 15 Common Rejection Codes
| Error Code | Official Description | Root Cause | Immediate Fix |
|---|---|---|---|
| 2150 | Duplicate IRN | Hash already exists in NIC DB for GSTIN+No+FY | Fetch existing IRN or issue new serial invoice |
| 2175 | Recipient GSTIN not active | Buyer suspended or cancelled on invoice date | Hold dispatch or verify GST portal revocation |
| 2182 | HSN does not exist in master | Obsolete code or less than 6 digits | Use 6/8 digit active code from Tariff master |
| 2283 | Distance unavailable for PINs | Origin and Destination PINs lack GIS route | Set Distance = 0 for auto-calculation |
| 2194 | Item taxable value mismatch | Qty × Unit Rate minus discount ≠ AssAmt | Re-verify line-item arithmetic in ERP |
| 2197 | Total invoice value mismatch | Rounding variance exceeds ±₹2.00 | Adjust RndOffAmt node within ₹2.00 tolerance |
| 2144 | Invalid State Code | State code does not match first 2 digits of GSTIN | Align Stcd with GSTIN prefix (e.g. 27 for MH) |
| 2265 | Invalid vehicle number format | Format lacks space or standard RTO pattern | Format as DL01AB1234 without hyphens/dots |
11. Signed QR Code Printing Statutory Requirements
The IRP does not generate or store physical PDF invoices. It returns a cryptographically signed digital string (Base64 QR code payload) and a 64-character IRN string. Under CBIC circulars:
• The physical or digital invoice copy handed to the transporter must display the QR code prominently (minimum 2x2 inches) on the face of the invoice.
• Mobile enforcement officers scan this QR code using the official "NIC E-Invoice Verifier" app without needing active internet to verify digital signature and authenticity.
12. Section 129 Vehicle Detention & Audit Penalties
Severe Repercussions of Non-Compliance:
If an entity mandated to issue e-invoices transports goods with a regular computer-generated invoice lacking an IRN:
- Legal Non-Existence: Under Rule 48(5), the document is treated as non-existent and the goods are deemed to be travelling without an invoice.
- Section 129 Detention: Enforcement squads impound the truck and cargo, demanding a penalty equal to 200% of the applicable tax before release.
- ITC Denial for Buyer: The corporate customer cannot claim Input Tax Credit under Section 16(2)(a), resulting in severe commercial vendor blacklisting.
13. ERP Pre-Validation Action Checklist
Recommended Video Tutorials & Practical Walkthroughs
Watch these handpicked, expert video guides covering practical compliance, step-by-step procedures, and real-world implementation:
Recommended Video Tutorials & Practical Guides
14. Frequently Asked Questions
How do you fix Error 2150: 'Duplicate IRN, already generated'?↓
Error 2150 occurs because an IRN has already been registered for the combination of Supplier GSTIN, Document Type, Document Number, and Financial Year. You cannot regenerate an IRN with the same invoice number even if the previous invoice was cancelled. To resolve, use the 'Get IRN Details' API to retrieve the existing signed invoice, or issue a fresh invoice with a new unique serial number.
What causes Error 2175: 'Recipient GSTIN is not active'?↓
Error 2175 triggers when the buyer's GSTIN is cancelled, suspended, or inactive in the GSTN master database as of the invoice date. You must check the buyer's status on the GST portal. If suspended, the buyer must revoke suspension, or the transaction must be treated as B2C (if permitted by nature of supply) or postponed until registration is restored.
How do you resolve Error 2182: 'HSN code does not exist in NIC master'?↓
Error 2182 happens when the HSN code entered is either obsolete, less than the required 6 digits (for turnover > ₹5 Cr), or does not match the 8-digit Customs Tariff Master. Cross-verify the HSN code using the 'Search HSN' tool on the e-invoice portal (einvoice1.gst.gov.in) and update your ERP item master.
What is Error 2283: 'Distance between pincodes is not available'?↓
Error 2283 appears when generating an integrated E-Way Bill along with the IRN if the pin-to-pin distance between supplier and recipient is missing in the NIC distance engine. In your JSON payload, set Distance = 0 to trigger automatic calculation, or provide the actual road transit distance manually (within a ±10% tolerance band).
Can an e-invoice with an error be modified or edited on the IRP portal?↓
No. Once an IRN is generated, it cannot be modified or partially edited on the IRP. Taxpayers have a strict 24-hour window from IRN generation to cancel the e-invoice. If the 24-hour window expires, the e-invoice can no longer be cancelled on the IRP; the error must be rectified by issuing a formal Credit Note or Debit Note under Section 34 of the CGST Act.
What are the legal consequences of transporting goods with an invalid or rejected e-invoice?↓
Under Rule 48(5) of the CGST Rules, any invoice issued by an e-invoicing mandatory entity without a valid cryptographically signed IRN and QR code is treated as invalid and non-existent. Goods in transit can be detained under Section 129 with a 200% penalty of tax payable, and the recipient is permanently barred from claiming Input Tax Credit under Section 16(2)(a).
15. Official Documentation & Related Guides
Official statutory references: CGST Rules, 2017 (Rule 48(4), 48(5), 138); Notification No. 13/2020-Central Tax; Notification No. 78/2020-Central Tax; NIC E-Invoice System Schema Specifications (Schema INV-01); and Section 129 of the CGST Act, 2017.













