How to Generate an IRN for E-Invoices in India (Step-by-Step)
If your business is above the e-invoicing threshold, every B2B invoice needs a valid Invoice Reference Number before it can be sent. Here's exactly how that process works.
New to e-invoicing?
Start with our overview of what e-invoicing means and who it applies to.
What you need before generating an IRN
A valid GSTIN, registered on the e-invoice portal (this is typically a one-time setup step)
Invoice data in the required schema — invoice number, date, GSTIN of both parties, line items, tax breakup
Either direct API access to the Invoice Registration Portal (IRP), or a GST Suvidha Provider (GSP)/billing software that handles the submission for you
The IRN generation process
1. Prepare the invoice JSON
Your billing software (or manual entry) structures the invoice into the standard e-invoice schema — this includes seller and buyer GSTIN, invoice number, date, item-level details, and the GST breakup.
2. Submit to the IRP
The JSON is submitted to the Invoice Registration Portal, either directly or through a GSP, along with your digital signature or authentication credentials.
3. IRP validates and computes the IRN
The portal checks the invoice for completeness and duplication, then computes a unique hash (the IRN) based on your GSTIN, invoice number, and financial year — this is what makes duplication effectively impossible.
4. IRN and signed QR code returned
The response includes the IRN, a digitally signed QR code, and the acknowledgement number/date — all of which typically get merged back onto your invoice PDF automatically if you’re using integrated software.
5. Send the finalized invoice
The invoice, now carrying the IRN and QR code, is sent to your client — this is what makes it valid under the e-invoicing mandate.
Common mistakes that cause IRN rejection
❌ Mismatched GSTIN details
✅ Double-check both your own and the buyer’s GSTIN against the GST portal before submission — a single incorrect digit causes a hard rejection.
❌ Incorrect HSN/SAC code format
✅ These codes have specific required lengths depending on your turnover slab — verify the correct digit count for your business size.
❌ Trying to reuse an invoice number
✅ Since the IRN is partly derived from your invoice number, duplicate invoice numbers within the same financial year will be rejected outright.
Frequently asked questions
Can I generate an IRN manually on the government portal?
Yes, for lower volumes, invoice data can be entered directly on the e-invoice portal. Most businesses with regular invoice volume instead use accounting/billing software integrated with a GST Suvidha Provider (GSP), since manual entry for every invoice doesn’t scale well.
How long does IRN generation take?
Typically a few seconds when submitted correctly via API integration — the IRP validates the invoice JSON and returns the IRN and QR code almost immediately. Manual portal entry takes longer simply due to data entry time.
Can an IRN be cancelled once generated?
Yes, but only within a limited time window (typically 24 hours) from generation, and only if the underlying invoice hasn’t been used for an e-way bill yet. After that window, you’d typically need to issue a credit note instead of cancelling the IRN.
Below the e-invoicing threshold?
InvoicePilot handles standard GST-compliant invoicing — no IRN needed. Free forever.
Start Free — No Credit Card →