# Cancel E-Waybill

You can use this API to cancel the E-Waybills.&#x20;

### Request Method

POST

### Request URL

```
{{HOST}}​/einv/v2/eInvoice/ewaybill/cancel
```

### Request Headers

| Parameter             | Data Type | Field Validations | Description                                                             |
| --------------------- | --------- | ----------------- | ----------------------------------------------------------------------- |
| X-Cleartax-Auth-Token | String    | NA                | Mandatory. The auth token generated from ClearTax user id and password. |
| Gstin                 | String    | NA                | Mandatory. GSTIN number for the user.                                   |

### Request Path Params

There are no path parameters for this API.&#x20;

### Request Query Params

There are no query parameters for this API.&#x20;

### Request Body

| Parameter     | Data Type | Field Validations | Description                                                                                                         |
| ------------- | --------- | ----------------- | ------------------------------------------------------------------------------------------------------------------- |
| ewbNo         | Body      | Number            | E-WayBill Number                                                                                                    |
| cancelRsnCode | Body      | String            | <p>Reason for cancellation Enum:</p><p>DUPLICATE</p><p>DATA\_ENTRY\_MISTAKE</p><p>ORDER\_CANCELLED</p><p>OTHERS</p> |
| cancelRmrk    | Body      | String            | Remarks                                                                                                             |

### Response Status Codes

| HTTP Status Code | Description                                                                  |
| ---------------- | ---------------------------------------------------------------------------- |
| 200              | For a successfully processed request (may be a success or validation error). |
| 400              | Bad Request. Invalid JSON Payload.                                           |
| 401              | If the user is not authenticated for the operation.                          |
| 403              | If the user is not authorized for the operation.                             |
| 500              | If there are any unhandled exceptions on the Clear side.                     |

### Response Schema

| Parameter    | Data Type   | Field Validations     | Description                                                                    |
| ------------ | ----------- | --------------------- | ------------------------------------------------------------------------------ |
| ownerId      | String      | NA                    | This field will always be null.                                                |
| gstin        | String      | NA                    | Gstin Number                                                                   |
| irn          | String      | 64 Digits             | Invoice Reference Number                                                       |
| ewbNumber    | <p><br></p> | 12 Digits             | E-Way Bill number                                                              |
| ewbStatus    | String      | Enum: Cancelled, null | Status of the E-Way Bill                                                       |
| errorDetails | Object      | NA                    | Error Details. If there is no error then the value of this field will be null. |

#### Error Details Object&#x20;

| Parameter      | Data Type | Field Validation | Description   |
| -------------- | --------- | ---------------- | ------------- |
| error\_code    | Number    | NA               | Error code    |
| error\_message | String    | NA               | Error message |
| error\_source  | String    | NA               | Error source  |

### Sample Request and Response

#### Request&#x20;

```json
{
    "ewbNo": 151256807504,
    "cancelRsnCode": "DUPLICATE",
    "cancelRmrk" : "Duplicate Entry"
}
```

#### Response - Success:

**HTTP Status Code - 200 OK**

```json
{
    "ownerId": null,
    "gstin": "29AAFCD5862R000",
    "irn": "385b6129a2da705952496775e85811c3a5ff9cc4bfba53649d57162d3d4bd3c8",
    "ewbNumber": 171010278843,
    "ewbStatus": "CANCELLED",
    "errorDetails": null
}
```

#### Response - Failure:&#x20;

**HTTP Status Code - 200 OK**

```json
{
    "ownerId": null,
    "gstin": "29AAFCD5862R000",
    "irn": null,
    "ewbNumber": 151011726811,
    "ewbStatus": null,
    "errorDetails": {
        "error_code": "107",
        "error_message": "cancelRsnCode : Cancel Reason Code is mandatory. Please correct the Cancel Reason Code and try again.",
        "error_source": "CLEARTAX"
    }
}
```

### API Validations

E-Waybill should be present in the ClearTax database under your dedicated workspace.&#x20;

### API Constraints&#x20;

1. E-way bills can be cancelled by the generator of the e-way bill only.
2. E-way bills can be cancelled within 24 hours of generation of e-way bill
