Cancel an IRN

NIC permits IRN cancellation within 24 hours of generation. Beyond that, you cannot cancel — you'd issue a credit note (documentType: "CRN") referencing the original invoice.

The call

POST /v1/einvoices/{id}/cancel HTTP/1.1
Host: api.in.onefinops.com
Authorization: Bearer ...
Idempotency-Key: cancel-INV-2026-00001
{
  "reasonCode": "1",
  "remarks": "Duplicate IRN — invoice was registered twice."
}

reasonCode is the IRP reason:

ValueReason
"1"Duplicate
"2"Data Entry Error
"3"Order Cancelled
"4"Other

remarks is required — max 100 characters, free text. NIC stores this verbatim against the cancellation record.

Successful response

{
  "id": "einv_01HRXY...",
  "object": "einvoice",
  "status": "cancelled",
  "irn": "a1b2c3d4...",
  "cancelledAt": "2026-05-04T13:22:18Z",
  "cancellationReason": "Duplicate IRN — invoice was registered twice.",
  ...
}

The IRN itself stays — NIC doesn't delete cancelled records. They're just flagged cancelled. This is intentional: the IRN is part of the audit trail.

Failure modes

CodeHTTPMeaning
einvoice.cancel_window_expired409More than 24 hours have passed since generatedAt.
einvoice.not_cancellable409IRN is in a state that can't be cancelled (e.g. it never reached generated).
not_found404Id doesn't belong to your tenant.
validation_error422reasonCode or remarks failed validation.

Coordinating with downstream systems

Cancellation is permanent for this IRN — once status: cancelled, you cannot reverse it. If you have downstream systems consuming the IRN (analytics, GSTR returns, your customer's portal), reconcile with the einvoice.cancelled webhook so they don't act on a stale generated snapshot.

If an e-Way Bill exists against this IRN, cancel the EWB first. NIC rejects IRN cancellation while an active EWB is linked.