Skip to content

Cancel E-Invoice by IRN (bulk)#

Cancel IRN(s) API supports cancellation of bulk e-invoices, as opposed to its basic counterpart. Cancel e-invoice in bulk is an asynchronous API, hence will give a task ID in response.

Given a task ID, you could fetch the task status using Status API. In order to download the result, you would need to use Result API.

Route

/enriched/einv/{flynn-version}/{irp}/invoices/cancel

  • active ‘flynn-version’: v3.0
  • method: POST

URL Parameters#

Name Description Type
flynn-version version of the API
for example, v3.0
string
irp IRP Provider as per GST registration for e-invoicing enum (ni1, ni2)

Headers#

All headers as mentioned in the Enriched E-Invoice API introduction.

Apart from the common headers need to pass below headers

header Description
irp This request header is mandatory if Taxpayer wants to perform interoperability / criss-cross operations on IRN. Accepted values are NIC1 or NIC2

Tip

The only valid values for the header keys Content-Type and accept must have to be application/json.

Request#

Body consists of two sections, “payload” and “meta”. payload contains actual e-invoice cancel requests in a list.

The schema of the payload is guided by the NIC portal. Please check the published documentation.

Sample Request Body

{
  "payload": [
    {
      "Irn": "ce0be34520169504660cfca54679b89a91d497b47bad37be468bd09a7e474d33",
      "CnlRsn": "1",
      "CnlRem": "Cancelled the order"
    },
    {
      "Irn": "eda240e614a3e90c2f62d31b5d149e429adaa4c91b3abdd48f2a67f4467d0fa9",
      "CnlRsn": "1",
      "CnlRem": "Cancelled the order"
    }
  ],
  "meta": null
}

Response#

200:#

Successful response will an async task-id. Using this task-id you will be able to fetch the status of the request.

Sample Response Body

{
  "status": "1",
  "data": {
    "task-id": "62cd1c61-1f10-4b50-a40d-333753802050"
  },
  "error": null,
  "info": null,
  "additionalInfo": null,
  "alert": null
}    
Result API Response:#

Result API response is unique for each API.

Sample Response Body

{
  "status": "1",
  "data": [
    {
      "status": "1",
      "data": {
        "Irn": "8990135794190074bbd44f3dd7c5d2ca6e0e1ee124552b86a32db0ed95cfd841",
        "CancelDate": "2023-07-14 03:11:00"
      },
      "error": null,
      "info": null,
      "additionalInfo": null,
      "alert": null
    },
    {
      "status": "1",
      "data": {
        "Irn": "edaa6a7e4f098be7eb35cc500201b60379085f678fdc53283aea98f95320b7e8",
        "CancelDate": "2023-07-14 03:11:00"
      },
      "error": null,
      "info": null,
      "additionalInfo": null,
      "alert": null
    }
  ],
  "error": null,
  "info": null,
  "additionalInfo": null,
  "alert": null
}     

data key will contain the list of responses for the respective list of documents requested for generating e-invoices.

Each successful item of the list contains, two key - status and details. For successful generation of IRN status will be True and details will contain response as per the ‘E-Invoice API Documentation’ published by NIC.

In the error scenario value of the status key will be False and error will contain error details.

List order will be maintained in the json response.

Notes#

IRP - nic is deprecated. Instead of it please use ni1 or ni2