Cancel an IRN
NIC permits IRN cancellation within 24 hours of generation. Past the window, the IRN cannot be cancelled — you'd issue a credit note (documentType: "CRN") referencing the original invoice instead.
The call
POST /v1/einvoices/cancel HTTP/1.1
Host: api.in.onefinops.com
Authorization: Bearer eyJhbGciOi...
gstin: 36AMBPG7773M002
Content-Type: application/json
X-Request-Id: 4f1d8a2c-…Body:
{
"irn": "a1b2c3d4e5f6...",
"reasonCode": "1",
"remarks": "Duplicate IRN — invoice was registered twice."
}reasonCode is NIC's cancellation reason:
| Value | Reason |
|---|---|
"1" | Duplicate |
"2" | Data entry error |
"3" | Order cancelled |
"4" | Other |
remarks is required (max 100 characters, free text). NIC stores it verbatim against the cancellation record.
Successful response
{
"irn": "a1b2c3d4e5f6...",
"ackNumber": 112324567890123,
"ackDate": "2026-05-14T11:42:18.000Z",
"status": "CNL",
"cancelDate": "2026-05-14T13:22:18.000Z",
"remarks": "Duplicate IRN — invoice was registered twice."
}After cancellation:
- Status moves to
CNL. Cancelled records are never deleted by NIC — they remain part of the audit trail and are still fetchable viaGET /v1/einvoices/irn?irn=…. - The signed JWS and QR are no longer returned on re-fetch. They were valid at the moment of registration; once cancelled, presenting them as a current invoice would be misleading.
If a linked EWB exists
NIC refuses to cancel an IRN while an active EWB is linked to it. Cancel the EWB first (POST /v1/ewaybills/cancel), then retry the IRN cancellation. The error you'd see otherwise:
{
"code": "upstream.failure",
"message": "EWB is active — cancel the EWB first",
"upstream": { "code": "4002", "message": "EWB is generated for this IRN" }
}Failure paths
| Status | Body code | Meaning |
|---|---|---|
| 404 | not_found | The IRN doesn't belong to your tenant. |
| 409 | einvoice.cancel_window_expired | More than 24 hours since ackDate. Issue a credit note instead. |
| 409 | einvoice.not_cancellable | IRN isn't in a cancellable state (already cancelled, or it failed to register in the first place). |
| 422 | validation_error | reasonCode or remarks failed validation. |
| 502 | upstream.failure | NIC refused — read upstream.code and upstream.message. The linked-EWB case above is the most common. |
Coordinating with downstream systems
Cancellation is permanent. If you have downstream systems consuming the IRN (analytics, GSTR-1 filings, customer portals), keep them in sync by re-fetching the IRN with GET /v1/einvoices/irn?irn=… after cancellation so they don't keep acting on a stale ACT snapshot.
Where to next
- Generate an IRN — the lifecycle this picks up from.
- Generate an EWB — if you need to cancel an EWB first.
- Errors — for the failure cases.
