# E-Invoice & E-WayBills: Cancel E-Waybill

This API is used to cancel ewayBill.

## URL

```
POST https://cloud.octagst.com/api/octa/einvoice/cancelewb?gstin={value}
```

## Query Parameters

| Name    | Description                  |
| ------- | ---------------------------- |
| `gstin` | It specifies GSTIN of seller |

## Request Payload

### Structure

| Parameter     | Data Type   | Type      | Description                                                                                            |
| ------------- | ----------- | --------- | ------------------------------------------------------------------------------------------------------ |
| ewbNo         | String(20)  | Mandatory | e-Waybill number                                                                                       |
| cancelRsnCode | String(1)   | Mandatory | Cancel reason<br/> `1`: Duplicate<br/>`2`: Order Cancelled<br/>`3`: Data entry mistake<br/>`4`: Others |
| cancelRmrk    | String(100) | Mandatory | Cancel remarks                                                                                         |

### Sample

```json
{
  "ewbNo": "791008693652",
  "cancelRsnCode": "2",
  "cancelRmrk": "Wrong HSN codes reported"
}
```

## Response Payload

### Success

Response payload will contain the success status.

| Parameter  | Data Type | Description                                     |
| ---------- | --------- | ----------------------------------------------- |
| Success    | Boolean   | `true` in case of success                       |
| CancelTime | String    | EWB cancellation time<br/>`DD/MM/YYYY HH:MM:SS` |

```json
{
  "Success": true,
  "CancelTime": "29/11/2020 09:34:11"
}
```

### Failure

If API request fails for some reason, response payload will contain the failure status and a list of errors.

```json
{
  "Success": false,
  "Errors": [
    {
      "Code": "ERR_CODE_1",
      "Message": "ERR MESSAGE 1"
    },
    {
      "Code": "ERR_CODE_n",
      "Message": "ERR MESSAGE n"
    }
  ]
}
```