E-invoicing.
Build an invoice payload, generate a deterministic mock IRN against a simulated NIC IRP, render a mock-signed QR. Every generated row is persisted with its payload so the recon engine can later match it back to GSTR-1. Only the IRP issues real IRNs - production wiring is a one-file swap behind generateMockIrn.
- Payload builder - schema-shaped e-invoice JSON assembled in-process
- Persistence + 24h cancel window - e-invoice rows and the 24-hour IRP cancellation-window logic are real
- IRN value - a demo hash for idempotency only - NOT the IRN NIC would register; the real IRN is computed and signed server-side by the IRP
- NIC IRP call - mocked - no live Invoice Registration Portal round-trip
- Digital signature - QR payload is a MOCK-SIGNED stand-in, not a GSP-signed JWS
A locally computed hash is never a legally valid IRN - only the IRP issues those. This module demonstrates the payload, persistence and lifecycle plumbing; production swaps generateMockIrn for a credentialed GSTN-authorised IRP/GSP call (e.g. Cygnet) that returns the registered IRN and signed QR.
Generate an IRN
generateMockIrn with callIrpGenerate) is one file change.