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’: v1.0
- method: POST
URL Parameters#
Name | Description | Type |
---|---|---|
flynn-version | version of the API for example, v1.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
{
"data": {
"task-id": "d139aedf-395a-4b6d-a76c-bb2c9bf83098"
}
}
Result API Response:#
Result API response is unique for each API.
Sample Response Body
{
"data": [
{
"status": true,
"details": "{\"Irn\":\"988610af33bfa7cf38114cd804d537d5b95e2cbe402962f8494ec3ff83992fc9\",\"CancelDate\":1592764200000}"
},
{
"status": false,
"error": {
"message": "err-irp-returned-error",
"type": "irp",
"args": {}
}
}
]
}
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