START A CONVERSATION

Let’s talk about your next build.

Prepare your brief below, then review and send it in your email app to sales@nextlabsonline.com.

THE FIRST CONVERSATION

Your product idea, AI opportunity or automation challenge—and a useful first milestone.

All fields are required.

A few sentences about the problem, your users and timing are enough.

We’ll use your details to respond to your enquiry. Please don’t include patient records, passwords or confidential information. Privacy Policy · Website Terms.

Logistics & supply chain / Logistics Data & Tech Standards

Generating E-Way Bills From E-Invoice IRN: Data Flow and Failures

By Vikasraj YadavPublished 9 min read

For supply chain it architects and product owners · Compare approaches

Generating E-Way Bills From E-Invoice IRN: Data Flow and Failures — Transport billing coordinator at an office desk overlooking a commercial truck dispatch yard, reviewing a paperclipped tan ruled form packet beside a desk stamp and dual monitors.

Generating E-Way Bills From E-Invoice IRN: Data Flow and Failures: Illustrative transport billing desk overlooking a commercial truck yard; not a client facility.

At a glance · Quick answer

Quick answer: e-invoice irn e-way bill

An e-way bill is generated from an e-invoice IRN on the NIC Invoice Registration Portal by sending the IRN with Part-B transport details: distance, mode, transporter ID, and vehicle or transport document. The IRP copies Part A from the registered invoice. CGST Rule 138(1) applies above ₹50,000, and the IRN cannot be cancelled while that e-way bill is active.

TL;DR — what you’ll learn

  • The IRP takes Part A from the registered e-invoice; your TMS supplies only distance, mode, transporter, and vehicle or transport document.
  • Declared distance must sit within plus or minus 10 percent of the IRP's PIN-to-PIN figure; sending 0 accepts the IRP's distance.
  • Ordinary cargo gets one day per 200 km or part under CGST Rule 138(10); 640 km means four days.
  • Cancel the e-way bill before the IRN, both within 24 hours; reversing the order returns IRP error 2230.

Topics: e-invoice irn e-way bill · IRN-to-EWB fields · transport details

All quantities, amounts, product codes and events are illustrative teaching examples.

The invoice has its IRN and a signed QR code, the truck is at the gate, and the e-way bill call keeps failing. The dispatcher sees "Invalid Vehicle Number", the TMS retries the same payload five times, and the driver waits forty minutes while someone reads the registration certificate aloud. Later the customer cuts the quantity, billing tries to cancel the invoice, and the portal refuses because an e-way bill now exists against it.

This guide follows one invoice from IRN to e-way bill on India's Invoice Registration Portal (IRP): which Part A fields the IRP lifts from the e-invoice, which Part-B transport fields your TMS must supply, how distance and validity are calculated, the order in which cancellations must happen, and what an ERP or TMS should do with each common error code. It ends with a test plan and an ownership split between billing, dispatch and the transport desk.

Where the IRN stops and the e-way bill starts on one invoice

The IRN is a tax document event; the e-way bill is a movement event. They share data but answer different questions, and treating them as one status in the ERP is the root of most failures. CGST Rule 48(4) requires notified taxpayers to prepare the invoice only after obtaining an IRN by uploading the invoice particulars in FORM GST INV-01, and Rule 48(5) says an invoice issued any other way by such a person is not treated as an invoice.

The e-way bill sits under a different rule. CGST Rule 138(1) requires a registered person moving goods of consignment value above ₹50,000 to furnish Part A of FORM GST EWB-01 before movement starts, with Part B carrying the conveyance details. The IRP's "generate e-way bill by IRN" service connects the two: the invoice already lodged on the IRP supplies the Part A data, and the caller adds the transport details.

  • Who must issue IRNs: Notification 10/2023-Central Tax reduced the aggregate-turnover threshold in Notification 13/2020-Central Tax from ₹10 crore to ₹5 crore with effect from 1 August 2023.
  • What the IRN is: the NIC specification describes it as a SHA-256 hash of the supplier GSTIN, document number, document type and financial year of the document date.
  • What the e-way bill adds: distance, transport mode, transporter, vehicle or transport document, and a validity date, which the IRP returns only once Part B exists.

This article covers creating the e-way bill from the IRN. Changing the vehicle after the truck has left is a different workflow, covered in our guide to handling an e-way bill vehicle change; read that one for breakdowns and transshipment, and this one for the moment the first e-way bill is raised.

Which Part A details the IRP takes from the signed e-invoice

When the e-way bill is generated by IRN, the caller does not resend the invoice. The IRP already holds the supplier, recipient, document number, date, item lines with HSN codes and values, so the request carries only the IRN plus transport details. Anything wrong in those invoice fields is fixed only by cancelling and reissuing the e-invoice, never in the e-way bill call.

Scroll horizontally to see all columns.

Field ownership in the IRN-to-e-way bill handoff
Field or groupWhere it comes fromSystem that holds itWho corrects it
Supplier and recipient GSTIN, document number, type and dateE-invoice uploaded to the IRPERP billing moduleBilling team, by cancel and reissue only
Item lines, HSN codes, taxable value and tax amountsE-invoiceERP billing moduleBilling team with the indirect tax lead
Dispatch-from address (DispDtls)E-invoice, or added in the e-way bill call if missingERP plant or warehouse masterMaster data owner
Ship-to address (ExpShipDtls)E-invoice, or added in the e-way bill call if missingERP customer master or orderOrder desk
DistanceE-way bill call (0 asks the IRP to calculate)TMS lane masterTransport planner
Transport mode, transporter ID and nameE-way bill callTMS carrier masterTransport desk
Vehicle number and type, or transport document number and dateE-way bill callTMS load or gate recordDispatcher at the gate

The NIC specification adds two rules that decide whether an e-way bill is possible at all. No e-way bill is generated for debit notes, credit notes or services, and at least one item on the invoice must carry an HSN code for goods. An invoice that bills only freight or installation therefore returns an error however clean the transport details are.

Part-B transport fields and the validations that reject them

Part-B data is where most rejections happen, because it is typed or scanned at the gate under time pressure. The IRP applies mode-specific rules: road needs a vehicle number and vehicle type, rail and air need a transport document number and date, and ship accepts either. Sending a field that the mode forbids is also an error.

  • Distance: mandatory; a number from 0 to 4000 kilometres. Zero tells the IRP to use its stored PIN-to-PIN distance.
  • TransMode: 1 road, 2 rail, 3 air, 4 ship.
  • TransId: the 15-character transporter ID or GSTIN. Sending only this produces a Part-A-only e-way bill.
  • VehNo and VehType: 4 to 20 alphanumeric characters, checked for format and against the Vahan vehicle database; type R for regular or O for over-dimensional cargo.
  • TransDocNo and TransDocDt: up to 15 characters and a date that cannot be in the future or earlier than the invoice date.

The IRP also refuses an e-way bill where the supplier or recipient GSTIN is blocked for non-filing of returns, returned as error 4015. No amount of retrying fixes that, and the TMS should stop at once and route the case to the indirect tax team rather than leave the dispatcher guessing.

// Decrypted Data for "generate e-way bill by IRN" (NIC e-invoice API v1.03)
// Illustrative values; Irn is the 64-character hash returned at IRN generation
{
  "Irn": "<64-character IRN from the e-invoice>",
  "Distance": 0,
  "TransMode": "1",
  "TransId": "29AAACX1234M1Z5",
  "TransName": "Example Roadways",
  "TransDocNo": "LR-118204",
  "TransDocDt": "13/11/2026",
  "VehNo": "KA01AB1234",
  "VehType": "R"
}
// Decrypted success response
{
  "EwbNo": 141008683051,
  "EwbDt": "2026-11-13 14:52:00",
  "EwbValidTill": "2026-11-17 23:59:00",
  "Remarks": "Pin-Pin calc distance: 640KM"
}
// Store all four values against the invoice and the TMS load; EwbValidTill
// is returned only when Part-B details were supplied.

Distance, PIN codes and the validity clock under Rule 138(10)

Distance decides validity, so it must be right before the truck moves. The IRP checks the declared distance against its stored PIN-to-PIN figure and accepts a variance of plus or minus 10 percent; where the stored distance is under 100 km the accepted range is 1 km up to plus 10 percent. Sending zero avoids the argument by accepting the IRP's own figure.

  • Same PIN code: the actual distance must be sent, between 1 and 100 km; zero is rejected with error 4029.
  • PIN pair not stored: the IRP uses the declared distance, up to 4000 km, and returns 4030 if zero was sent.
  • Validity for ordinary cargo: Rule 138(10) gives one day for the first 200 km and one more day for each further 200 km or part of it.
  • Validity for over-dimensional cargo: one day for the first 20 km and one more day for each further 20 km or part.
  • Extension: a proviso to Rule 138(10) allows extension within eight hours of expiry.

The Explanation to the validity rule counts from the time the e-way bill is generated, and treats each day as ending at midnight of the day following the generation date. A movement generated at 14:52 on 13 November with 640 km therefore gets four days ending at 23:59 on 17 November. Always store the EwbValidTill value the IRP returns rather than computing your own.

Scroll horizontally to see all columns.

Worked rupee example: one IRN-based dispatch from Bengaluru, with the US position noted
LineIndia (INR)United States (USD)
Taxable value on the e-invoice₹7,20,000Not applicable: no registered-invoice step
Tax on the invoice (illustrative 18% IGST)₹1,29,600Not applicable
Consignment value against the ₹50,000 trigger in Rule 138(1)₹8,49,600, so an e-way bill is requiredNo government movement document for domestic road freight
Stored PIN-to-PIN distance640 km; accepted declared range 576 to 704 kmNot applicable
Validity under Rule 138(10)1 day + 3 days for the remaining 440 km = 4 daysNot applicable
Cost of a 3-hour gate hold at an illustrative ₹650 per hour detention₹1,950 per truck, before any missed delivery slotNot applicable

Under CGST Rule 138(10), an e-way bill for ordinary cargo is valid one day for the first 200 km plus one day per further 200 km or part, so a 640 km dispatch raised by IRN from an ERP gets four days, with extension allowed within eight hours of expiry.

Two ways to raise the e-way bill: inside the IRN call or after it

Choose the timing by when the vehicle is known. If billing already has the vehicle and distance, the e-way bill details can travel inside the IRN request and both numbers come back together. If not, generate the IRN alone and raise the e-way bill by IRN once the truck reaches the gate.

  • Combined in the IRN request: the Generate IRN payload accepts an EwbDtls object with distance, mode, transporter, document and vehicle fields. The response then carries AckNo, the signed QR code, EwbNo, EwbDt and, when Part B was given, EwbValidTill.
  • Separate call after the IRN: the "generate e-way bill by IRN" service takes the IRN and transport fields only, and can also add dispatch or ship-to addresses that were missing from the invoice.
  • Part A only: sending just the transporter ID creates the e-way bill without Part B; the transporter adds the vehicle later, and the IRP returns no validity date until then.

The separate call needs its own retrieval path. The "get e-way bill details by IRN" service returns EwbNo, EwbDt, the generating GSTIN, a status of ACT or CNL, and EwbValidTill only where Part B exists. A TMS that lost a response after a timeout should call it before trying to generate again, because a second attempt returns error 4002.

Cancelling in the right order when an invoice or load changes

When an invoice must be withdrawn, cancel the e-way bill first and the IRN second, both inside their 24-hour windows. Reversing that order fails: the IRP refuses to cancel an IRN while a valid or active e-way bill exists for it, returning error 2230.

  • IRN cancellation window: 24 hours from IRN generation; afterwards the IRP returns error 2270.
  • IRN cancel reasons: 1 duplicate, 2 data entry mistake, 3 order cancelled, 4 others, with optional remarks up to 100 characters.
  • E-way bill cancellation: Rule 138(9) allows cancellation within 24 hours of generation, but not once the bill has been verified in transit under Rule 138B. The IRP's own error 4055 words its window as 24 hours from Part B entry.
  • After an IRN is cancelled: the NIC specification does not allow an IRN to be generated again for the same document number, so the corrected invoice needs a new number.

The NIC e-invoice IRP cancels an IRN only within 24 hours of generation and refuses while an active e-way bill exists, while CGST Rule 138(9) allows e-way bill cancellation within 24 hours unless verified in transit. An ERP correction workflow must therefore cancel the e-way bill first, then the IRN.

The trace below shows what a change looks like when the ERP treats both documents as one status. All numbers are illustrative.

  1. 10:02 IRN generated: billing posts invoice KA/2627/004517 for ₹8,49,600 and receives its IRN without e-way bill details, because no truck is assigned yet.
  2. 14:30 first e-way bill attempt: the gate TMS calls generate by IRN with vehicle KA01AB1Z34. The IRP returns 4014, Invalid Vehicle Number; the TMS retries the same payload five times in two minutes.
  3. 14:52 e-way bill generated: the dispatcher corrects the number to KA01AB1234 from the registration certificate; the IRP returns EwbNo 141008683051, valid until 17 November.
  4. 16:10 customer cuts the order: billing calls Cancel IRN with reason 3; the IRP returns 2230 because the e-way bill is active. The ERP shows the invoice as cancelled anyway.
  5. 16:25 recovery: the transport desk cancels the e-way bill, billing cancels the IRN, and a new invoice number KA/2627/004533 is raised for the reduced quantity with a fresh e-way bill.

IRP error codes a TMS should route, not blindly retry

Most IRP errors describe data that will fail identically on every retry. The integration should map each code to an owner and an action, retry automatically only for transport-level faults such as a timeout, and look up the existing e-way bill before any repeat generation attempt.

Scroll horizontally to see all columns.

Common IRP error codes on the IRN-to-e-way bill path and the right response
CodeWhat the IRP is sayingLikely causeAction in the ERP or TMSAuto-retry?
4002E-way bill already generated for this IRNLost response after timeout, then resendFetch details by IRN and store themNo
4003Requested IRN data is not availableWrong IRN or wrong GSTIN in the headerCheck IRN and GSTIN, then escalate to billingNo
4009 / 4010Needs a goods HSN; no e-way bill for notes or servicesService-only invoice or a credit noteRemove from e-way bill queueNo
4011 / 4022Road mode needs vehicle number and typeTruck not yet assignedHold at gate until the vehicle is capturedNo
4013 / 4038Distance too high or low for the PIN pairLane master differs from the IRP figureResend with 0 or correct the lane distanceNo
4014Invalid vehicle numberTypo or vehicle missing in VahanDispatcher checks the registration certificateNo
4015Blocked userSupplier or recipient GSTIN blockedStop dispatch; route to indirect tax leadNo
4018 / 4019Invalid or missing transporter IDCarrier master wrongTransport desk fixes carrier masterNo
4021Transport document date before invoice dateLR dated from a previous dayCorrect the LR dateNo
4029 / 4030Distance 0 not allowed for same PIN or unknown pairZero sent where actual km is neededSend actual road distanceNo
2230IRN cannot be cancelled while e-way bill existsCancellation order reversedCancel e-way bill firstNo
2270IRN cancellation time limit crossedMore than 24 hours since IRNRoute to tax lead for the correction routeNo

Who in billing, dispatch and the transport desk fixes which field

Split the work by the document each team controls. Billing owns everything that lives in the e-invoice; dispatch owns the vehicle and gate time; the transport desk owns carrier masters, distance lanes and e-way bill cancellations. The ERP should show one dispatch case with both document states, not one combined green tick.

That split also decides which tasks can be automated. The IRP itself enforces its validations, so the ERP and TMS can apply the same checks before calling it. Software, including AI tools, helps with the human parts: reading a number plate or explaining an error. Decisions with tax consequences, such as cancelling an invoice, stay with named people.

Scroll horizontally to see all columns.

IRP-enforced checks versus assisted tasks at the dispatch gate
TaskFixed check before or at the IRPWhere tools or AI helpWho acts
Blocking a road e-way bill without a vehicle numberYes: TMS pre-check mirrors error 4011None neededDispatcher
Keeping declared distance within plus or minus 10 percentYes: IRP tolerance; TMS can send 0Route engine flags lanes that drift from IRP figuresTransport planner
Reading the vehicle number from a gate camera photoNoPlate recognition fills VehNo for checkingDispatcher confirms against the registration certificate
Supplying actual km when the IRP returns 4030NoMap service proposes a road distanceTransport planner accepts or edits
Explaining an unfamiliar IRP error code at the gateNoAssistant turns the code table into a plain instructionDispatcher follows the mapped action
Deciding to cancel and reissue an invoiceNoERP lists IRN and e-way bill states and time leftBilling lead with indirect tax approval

E-way bill generation by IRN on the NIC IRP accepts a road movement only with vehicle number and type, checks the number against Vahan, and allows declared distance within 10 percent of the stored PIN-to-PIN figure, while CGST Rule 138(1) sets the ₹50,000 consignment value that triggers the requirement.

Proving the IRN-to-e-way bill path in the NIC sandbox

Run every failure in the NIC sandbox before go-live, not only the happy path. Each scenario below has an expected result the integration must reproduce, including the error code. A build that shows the right code to the right person passes; one that retries or swallows the error fails.

From e-invoice IRN to a valid e-way bill on the NIC IRP Step 1, Billing: Register invoice and get IRN. Invoice particulars uploaded under Rule 48(4); IRN, AckNo and signed QR returned; No vehicle yet: IRN alone. Step 2, Gate and TMS: Send IRN with Part-B details. Distance, mode and transporter ID; Road: vehicle number and type; Rail or air: document number and date. Step 3, IRP checks: Validate and issue e-way bill. Vahan check on vehicle number; Distance within 10 percent of PIN pair; Returns EwbNo and valid-till date. Step 4, Changes: Cancel in the right order. E-way bill first, within 24 hours; IRN second, within 24 hours; Reissue under a new invoice number. From e-invoice IRN to a valid e-way bill on the NIC IRP India-only flow: billing registers the invoice, the gate adds transport details, the IRP returns validity 1 · BILLING Register invoice and get IRN • Invoice particulars uploaded under Rule 48(4) • IRN, AckNo and signed QR returned • No vehicle yet: IRN alone 2 · GATE AND TMS Send IRN with Part-B details • Distance, mode and transporter ID • Road: vehicle number and type • Rail or air: document number and date 3 · IRP CHECKS Validate and issue e-way bill • Vahan check on vehicle number • Distance within 10 percent of PIN pair • Returns EwbNo and valid-till date 4 · CHANGES Cancel in the right order • E-way bill first, within 24 hours • IRN second, within 24 hours • Reissue under a new invoice number

Scroll horizontally to see all columns.

Sandbox test plan for e-way bill generation and cancellation by IRN
ScenarioInputExpected IRP resultExpected ERP or TMS behaviour
Road dispatch with vehicleIRN, distance 0, mode 1, vehicle and typeEwbNo, EwbDt and EwbValidTill returnedAll three stored on invoice and load
Part A onlyIRN, distance, transporter ID onlyEwbNo without validityLoad flagged "awaiting Part B"
Same PIN with zero distanceDistance 0, identical PINsError 4029Planner prompted for actual km
Mistyped vehicle numberUnregistered numberError 4014No auto-retry; dispatcher task created
Repeat generation after timeoutSame IRN twiceError 4002 on second callDetails fetched by IRN instead
Credit noteIRN of a credit noteError 4010Document never queued for e-way bill
Cancel IRN with active e-way billCancel reason 3Error 2230Workflow cancels e-way bill first
Correct order of cancellationCancel e-way bill, then IRNBoth cancelledInvoice number retired; new number required

Shortages and damages found at the customer's dock are a separate reconciliation problem; our guide to dock-to-dispatch e-way bill and POD shortage reconciliation covers that end of the trip. For freight bills that later reference the same LR and invoice, see freight accounts payable automation and GST reconciliation.

Running both documents as one visible dispatch case

The fix for most IRN and e-way bill failures is organisational as much as technical: show both document states on one dispatch case, map every error code to an owner, and let only the right person cancel. With that in place, the gate stops waiting on retries and billing stops cancelling invoices the portal still considers live.

  • Separate states: IRN status, e-way bill status and Part-B status shown side by side, each with its time remaining to cancel.
  • Coded error routing: every IRP code mapped to billing, dispatch, the transport desk or the tax lead, with automatic retry only for timeouts.
  • Cancellation guard: the ERP blocks an IRN cancel request while the e-way bill status is active.

Related transport and GST compliance guides are collected in our logistics section. If your ERP or TMS needs this flow built or reviewed against the NIC specification, share your requirements with us and we will map your current error handling against the codes above before any build starts.

Discuss this workflow

Describe your current systems, the recurring exception and the outcome you need. Keep shipment, customer and financial records out of the initial message.

START A CONVERSATION

Let’s talk about your next build.

Prepare your brief below, then review and send it in your email app to sales@nextlabsonline.com.

SELECTED INDUSTRYLogistics & supply chain

Article: Generating E-Way Bills From E-Invoice IRN: Data Flow and Failures · Logistics Data & Tech Standards

THE FIRST CONVERSATION

Your product idea, AI opportunity or automation challenge—and a useful first milestone.

All fields are required.

A few sentences about the problem, your users and timing are enough.

We’ll use your details to respond to your enquiry. Please don’t include patient records, passwords or confidential information. Privacy Policy · Website Terms.

Common operational questions

Practical answers for operations, engineering, and finance teams working on e-invoice irn e-way bill in logistics & supply chain.

Can an e-way bill be generated after the IRN, using the IRN?
Yes. The NIC IRP offers a generate e-way bill by IRN service that takes the IRN plus transport details. If e-way bill details were missing or incomplete when the IRN was generated, the IRN is still issued without an e-way bill number, and the e-way bill can be raised later.
Why does the IRP refuse to cancel an IRN with error 2230?
The IRP will not cancel an IRN while a valid or active e-way bill exists for it. Cancel the e-way bill first, within its 24-hour window and before any verification in transit, and then cancel the IRN within 24 hours of its generation, giving a cancel reason code.
What distance should a TMS send when generating an e-way bill by IRN?
Send 0 to accept the IRP's stored PIN-to-PIN distance, or a declared figure within plus or minus 10 percent of it. Where both PIN codes are the same, send the actual distance between 1 and 100 km. Where the PIN pair is unknown, send the actual road distance.
Should the integration retry when the IRP returns an error code?
Only for timeouts and gateway faults. Coded validation errors such as 4014 for an invalid vehicle number or 4013 for distance fail the same way every time. After a timeout, fetch the e-way bill details by IRN first, because a repeat generation attempt returns error 4002.

References

Sources checked 13 November 2026. US and India statutory authorities and vendor documentation support platform facts; the worked examples and diagrams are original.

About the author

Vikasraj Yadav writes about operational decisions, software and automation for NextEdge Labs.