GST Compliance

How to Generate an IRN (Invoice Reference Number)

Invodo Editorial Reviewed by a Chartered Accountant Updated 15 Jun 2026 5 min read
How to Generate an IRN (Invoice Reference Number)

If you've just become liable for e-invoicing, the practical question is simple: how to generate an IRN for your B2B invoices? The IRN, or Invoice Reference Number, is the unique identifier the Invoice Registration Portal (IRP) returns for every eligible invoice you report. This guide walks through what an IRN is, what you need ready beforehand, the step-by-step process, what the IRP gives back, and the errors that most often cause rejection.

What is an IRN?

An Invoice Reference Number (IRN) is a unique 64-character hash generated by the IRP for each invoice you report to it. The IRP computes the IRN from a defined combination of your supplier GSTIN, document type, document number and financial year, ensuring no two valid invoices can share the same IRN. It is effectively the government's stamp confirming your invoice has been registered.

An invoice that requires e-invoicing is not legally valid for your B2B supply until it carries a valid IRN and the accompanying signed QR code. E-invoicing is required only for B2B invoices, exports, and credit and debit notes — never for B2C sales. To understand whether you're even in scope, read our explainer on e-invoice applicability and turnover limits, and for the full system overview see our GST e-invoicing guide.

What do you need before generating an IRN?

The IRP is strict about data quality. Before you attempt to generate an IRN, make sure you have the following in order:

  • Valid supplier and recipient GSTINs — both must be active and correctly formatted. The IRP validates the recipient GSTIN, so a cancelled or wrong GSTIN will fail.
  • Correct HSN/SAC codes for every line item, at the digit-length your turnover requires.
  • Accurate tax breakup — CGST, SGST, IGST and cess that internally reconcile with the taxable values.
  • Unit Quantity Codes (UQC) in the standard format the schema expects (for example, NOS, KGS, BOX).
  • The invoice in the prescribed JSON schema — the IRP only accepts data in the standardised e-invoice JSON schema (INV-01), not as a PDF or image.

The full schema and validation rules are published at einvoice.gst.gov.in. Getting your master data right here saves enormous rework later.

Step-by-step: generating an IRN on the IRP

There are three common ways to generate an IRN. Choose the one that fits your volume:

  1. Direct on the IRP portal — log in to the e-invoice portal, manually enter or upload a single invoice (or a bulk file), and submit. This suits low volumes.
  2. Via a GSP (GST Suvidha Provider) — a registered intermediary connects your system to the IRP. Good for medium volumes without building your own integration.
  3. Via direct API integration — your billing software calls the IRP API in real time as each invoice is created. This is the cleanest option for higher volumes and is how most modern accounting tools work.

Regardless of the route, the underlying flow is the same: your system prepares the invoice in the e-invoice JSON schema, transmits it to the IRP, and the IRP validates it. If everything passes, the IRP registers the invoice and returns the IRN and QR code. Whether you click a button in software or call an API, you are doing the same thing — handing a schema-valid JSON to the IRP and receiving a registered invoice back.

What does the IRP return?

On successful registration, the IRP responds with a signed payload that contains:

  • The IRN — the unique 64-character hash for that invoice.
  • A digitally signed QR code — issued by the IRP, it encodes key invoice details (GSTINs, invoice number, value, IRN, etc.) and proves the invoice was registered.
  • An acknowledgement number and acknowledgement date/time.
  • The signed invoice JSON.

This signed QR code is the visible proof of registration and is what your customers and tax officers can scan to verify authenticity. Keep the signed response stored against the invoice in your records.

How do you print the QR code on your invoice?

Once you receive the signed QR code from the IRP, you must print it on the physical or PDF copy of the invoice you issue to your customer. Practical points:

  • Place the QR code clearly on the invoice — it must be scannable, so don't shrink it below a usable size or print it over text.
  • You may also print the IRN and acknowledgement number for reference, though the QR code is the mandatory element.
  • Do not generate your own QR code — only the IRP-signed QR code is valid. A self-made QR code does not satisfy the requirement.

Good invoicing software handles this automatically, embedding the IRP's signed QR code into your invoice template the moment the IRN comes back.

Common errors that cause IRP rejection

The IRP rejects invoices that fail validation. The most frequent culprits are:

  • Invalid or cancelled recipient GSTIN — always validate before submitting.
  • Duplicate IRN — the same document number reported twice; the IRP will not register a duplicate.
  • Wrong or missing HSN/SAC codes — codes that don't exist in the master or don't meet the required digit length.
  • Tax mismatch — computed CGST/SGST/IGST values that don't tally with taxable value and rate.
  • Incorrect place of supply or supply type — for example, charging IGST on an intra-state supply.
  • Schema violations — missing mandatory fields or values in the wrong format.

After generating an IRN you may still need to make changes — see our guide on cancelling or amending an e-invoice. And remember that for transporting goods you'll often also need an e-way bill, which can be generated alongside the IRN. Refer to einvoice.gst.gov.in for the authoritative error-code list.

Generating IRNs by hand is slow and error-prone. Invodo validates GSTINs and HSN codes up front, builds the e-invoice JSON for you, calls the IRP automatically, and prints the signed QR code straight onto your invoice — so every B2B document is compliant the moment it's issued. Explore Invodo's e-invoicing features to see how it removes the manual work.

Put this into practice with Invodo

GST-compliant invoicing, e-invoicing, and purchase management built for Indian businesses.

Invodo Editorial

Reviewed by a Chartered Accountant

The Invodo editorial team writes practical, India-specific guides on GST and business finance. Compliance content is reviewed by a practising Chartered Accountant.

Related articles