Skip to content

Cancel E-way Bills#

Cancel EWB(s) API supports cancellation of bulk e-way bills, as opposed to its basic counterpart. Cancel e-ewb API will give a reference ID in response.

Given a reference ID, you could fetch its status and number of completed and pending e-way bills using Status API. In order to download the result, you would need to use Result API.

Route

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

  • 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.

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 EWB 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": [
    {
      "ewbNo": 611008686183,
      "cancelRsnCode": "1",
      "cancelRmrk": "Cancelled the order"
    },
    {
      "ewbNo": 12345678,
      "cancelRsnCode": "1",
      "cancelRmrk": "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": "{\"ewayBillNo\":\"611008686183\",\"cancelDate\":\"10/08/2020 10:52:00 AM\"}"
    },
    {
      "status": false,
      "error": {
        "message": "err-received-error",
        "type": "communication",
        "args": {
          "error-details": "{\"errorCodes\":\"312,\"}"
        }
      }
    }
  ]
}

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