To generate an IRN, register your GSTIN on an Invoice Registration Portal, create the invoice in your billing system, convert it to the e-invoice JSON format and submit it to the IRP through the portal, offline tool or an API. The IRP validates the data and returns a 64-character IRN, a digitally signed invoice and a signed QR code to print on the invoice.
Once your business falls under GST e-invoicing, every B2B invoice needs an Invoice Reference Number (IRN) before it is valid. Generating one is not hard, but the steps — registration, JSON preparation, upload and printing — are unfamiliar the first time. This guide walks through each step and the choices you have.
What is an IRN and who issues it?
An IRN is a unique 64-character reference generated by the Invoice Registration Portal (IRP) for each e-invoice. It is a hash based on four values:
- Supplier GSTIN
- Financial year
- Document type (invoice, credit note or debit note)
- Document number
Because of this, the same combination can only ever produce one IRN. That is how the system prevents the same invoice number being registered twice.
The IRN is issued by an IRP, not by your software. Your software simply sends the data and receives the result. If you are new to the concept, start with what is e-invoicing.
What do you need before generating an IRN?
Check this list before your first invoice.
| Requirement | Why it matters |
|---|---|
| GSTIN enabled for e-invoicing | The IRP only accepts covered GSTINs |
| E-invoice portal registration | Gives you login and, if needed, API access |
| Correct buyer GSTIN and address | Validated by the IRP |
| Valid PIN code matching buyer's state | Mismatches cause rejection |
| HSN/SAC codes (6 digits for covered businesses) | Validated against the HSN master |
| A unique document number | Duplicates are rejected |
| Invoice date within reporting window | ₹10 crore+ businesses have a 30-day limit |
If you are not sure whether you are covered, see the e-invoice applicability limit.
How to register on the e-invoice portal
- Open the e-invoice portal (for example einvoice1.gst.gov.in).
- Choose e-Invoice Registration if you have no e-way bill login; if you do, log in with your e-way bill credentials.
- Enter your GSTIN and the captcha; an OTP is sent to the mobile number registered on the GST portal.
- Verify the OTP and create a username and password.
- After logging in, go to the API registration section if you plan to connect software, and choose either "through GSP" or "direct" access.
- If using a GSP, select it and create API credentials; your billing software will store and use these.
What are the ways to generate an IRN?
There are three practical routes.
1. Offline utility (bulk generation tool)
Download the bulk generation tool from the portal, fill invoice details in the spreadsheet or form, and generate a JSON file. Upload that file on the portal under e-Invoice → Bulk Upload. The result file contains the IRN and signed QR code for each invoice. Suitable for a handful of invoices per month.
2. Through a GSP or billing software
Your billing software prepares the JSON automatically and sends it through a GST Suvidha Provider's API. The IRN and QR code come back into the software and appear on the printed invoice. This is the most common route for small and mid-sized businesses.
3. Direct API
Larger businesses with their own ERP can connect directly to the IRP with their own API credentials. This needs technical work and meets eligibility conditions set by the portal.
Step-by-step: generating an IRN on one invoice
Using a billing system connected to an IRP, the steps look like this:
- Create the invoice with buyer, items, HSN, quantity, rate, discount and tax.
- Check the document type: INV for invoice, CRN for credit note, DBN for debit note.
- Choose the supply type: B2B, SEZ with or without payment, export with or without payment, or deemed export.
- Add transport details if you want an e-way bill at the same time (vehicle number or transporter ID, distance).
- Submit to the IRP.
- Receive the IRN, acknowledgement number and date, signed invoice and signed QR code.
- Print or share the invoice with the IRN and QR code; the e-way bill number appears if Part B was included.
In Billing Software by Betterwork, steps 5 to 7 happen in one click from the invoice screen, and the IRN is stored against the invoice for later lookup.
Worked example: a ₹2,36,000 B2B invoice
A Pune electrical contractor bills a registered Bengaluru builder for cable and switchgear.
| Item | HSN | Qty | Rate | Value |
|---|---|---|---|---|
| Copper cable (coil) | 854449 | 50 | ₹2,800 | ₹1,40,000 |
| MCB distribution board | 853720 | 20 | ₹3,000 | ₹60,000 |
| Taxable value | ₹2,00,000 | |||
| IGST @ 18% | ₹36,000 | |||
| Invoice total | ₹2,36,000 |
The supply is inter-state (Maharashtra to Karnataka), so IGST applies. The contractor's software builds the JSON with:
- Supplier GSTIN starting with state code 27, buyer GSTIN with state code 29.
- Place of supply 29.
- Two item lines, each with HSN, quantity, unit price, assessable value, IGST rate and amount.
- Value totals: assessable ₹2,00,000; IGST ₹36,000; total ₹2,36,000.
The IRP checks that totals add up (with the allowed rounding tolerance), that both GSTINs are active, that the HSN codes exist and that document number "PN/25-26/0418" has not been registered before. It returns the IRN and QR code. Because the consignment exceeds ₹50,000 and moves inter-state, the contractor also includes the vehicle number and distance, and receives an e-way bill number in the same response.
Use the GST calculator if you want to check line-level tax before submission.
What does the IRP send back?
| Output | What it is | Where to use it |
|---|---|---|
| IRN | 64-character hash | Print on invoice; quote in correspondence |
| Ack No. and Ack Date | Acknowledgement of registration | Print on invoice; audit trail |
| Signed invoice | Invoice JSON signed by IRP | Keep in records |
| Signed QR code | Key invoice data plus signature | Print on invoice for verification |
| E-way bill number (optional) | If transport details sent | Carry with goods |
The QR code is explained in e-invoice QR code.
How to fetch an IRN you already generated
If your system crashes after submission, do not resubmit blindly — you will get a duplicate error. Instead:
- Log in to the IRP or use your software's "get IRN by document details" option.
- Search by document type, number and date.
- Download the signed invoice and QR code and attach them to the invoice in your system.
How to generate IRNs for credit notes, exports and SEZ supplies
The core steps are the same for every document, but a few fields change.
Credit and debit notes
Set the document type to CRN or DBN, use the note's own number and date, and include the original invoice reference in the preceding-document details. The note gets its own IRN and QR code. A credit note on an e-invoiced supply is not valid without one. Format and time-limit rules are in credit note under GST.
Exports
Use the export supply type — with payment of IGST or without payment under a letter of undertaking. In the buyer section, the GSTIN field takes "URP" (unregistered person), the place of supply is the code for "other country", and export details such as port code, shipping bill number (if available) and foreign currency are filled in. The guide on export invoice under LUT explains the invoice side.
SEZ supplies
Choose "SEZ with payment" or "SEZ without payment". The buyer is the SEZ unit or developer with its own GSTIN. These supplies are always treated as inter-state, so IGST applies where tax is charged.
Bill-to / ship-to invoices
Where goods are billed to one party and delivered to another, fill the ship-to (and if relevant dispatch-from) details. The e-way bill generated through the IRP will use the ship-to address for distance and destination.
What should a daily IRN routine look like?
For a business issuing 20 to 200 B2B invoices a day, a simple routine prevents most problems:
- Morning: check that yesterday's invoices all show an IRN; follow up any that failed.
- Before dispatch: generate the IRN (and e-way bill) before printing, never after goods leave.
- Midday: review rejection messages and fix master data at source — the customer or item record — not just on the invoice.
- End of day: reconcile the count of invoices issued with IRNs received.
- Weekly: check that no invoice is approaching the 30-day reporting limit if you are a ₹10 crore+ business.
Timing rules you must respect
- 30-day limit: businesses with aggregate turnover of ₹10 crore or more cannot report invoices whose document date is more than 30 days old. The limit applies from 1 April 2025 under GSTN's advisory. See the 30-day reporting limit.
- 24-hour cancellation: you can cancel an IRN only within 24 hours. See cancel e-invoice.
What to check after the IRN is generated
Before sending the invoice, confirm that the IRN, acknowledgement number and date, and the signed QR code have been saved against the invoice in your system.
Common mistakes when generating an IRN
- Resubmitting after a timeout and hitting a duplicate error, instead of fetching the existing IRN.
- Wrong PIN code for the state, especially for buyers with offices in multiple states.
- 4-digit HSN codes where 6 digits are required.
- Rounding differences between line totals and invoice totals beyond the IRP's tolerance.
- Wrong supply type for SEZ and export invoices.
- Generating the IRN on a draft that is later changed; any change after IRN generation needs a cancellation or credit note.
For a full list of rejection causes and fixes, see e-invoice common errors.
Key takeaways
- An IRN is a 64-character hash issued by an IRP using supplier GSTIN, financial year, document type and number.
- Register on the e-invoice portal, then generate IRNs via offline tool, GSP software or direct API.
- The IRP returns the IRN, acknowledgement, signed invoice and signed QR code, plus an e-way bill if transport details are sent.
- Never resubmit a timed-out invoice; fetch the IRN by document details.
- Watch the 30-day reporting limit and the 24-hour cancellation window.
This guide is general information, not tax advice. Rules last checked on 20 October 2026; confirm with your tax professional for your situation.
