# Extend E-Waybill Validity

You can Extend Validity an EWB by sending a **`POST`** request to E-Invoicing API with the following request headers.

### Request Method

POST

### Request URL

```
{{HOST}}/einv/v1/ewaybill/update?action={{action}}
```

### Request Headers

<table><thead><tr><th width="195.33331298828125">Parameter</th><th width="174.3333740234375">Data Type</th><th width="185.33331298828125">Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>X-Cleartax-Auth-Token</td><td>Header</td><td>String</td><td>Mandatory. The auth token generated from ClearTax user id and password. <a href="https://docs.cleartax.in/cleartax-for-developers/e-invoicing-api/e-invoicing-api-reference/authentication-token">Know how.</a></td></tr><tr><td>gstin</td><td>Header</td><td>String</td><td>Mandatory. GSTIN number for the user</td></tr></tbody></table>

### Request Path Params

There are no path parameters for this API.

### Request Query Params

| Parameter | Data Type | Field Validations | Description                  |
| --------- | --------- | ----------------- | ---------------------------- |
| Parameter | Data Type | Field Validations |                              |
| action    | String    | NA                | Mandatory = EXTEND\_VALIDITY |

### Request Body

| Parameter                                   | Data Type | Field Validations                                                                   | Description                                                           |
| ------------------------------------------- | --------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| EwbNumber                                   | Number    | 12 Digits                                                                           | Mandatory. E-Way Bill Number                                          |
| VehNo                                       | Number    | 15 Digits                                                                           | Conditional. Required where mode of transport is Road. Vehicle Number |
| FromPlace                                   | String    | 12 Characters                                                                       | Mandatory. From Place                                                 |
| FromState                                   | Number    | 2 Digits                                                                            | Mandatory. From State Code                                            |
| ReasonCode                                  | Enum      | "NATURAL\_CALAMITY", "TRANSSHIPMENT", "OTHERS", "ACCIDENT", "LAW\_ORDER\_SITUATION" | <p>Mandatory,</p><p>Reasons code</p>                                  |
| ReasonRemark                                | String    | 50 Characters                                                                       | Mandatory. Reason Remark                                              |
| TransDocNo                                  | String    | 15 Characters                                                                       | Optional. Transport Document Number                                   |
| TransDocDt                                  | String    | dd/mm/yyyy                                                                          | Optional. Transport Document Date                                     |
| <p>TransMode</p><p><br><br><br><br><br></p> | Enum      | <p>[ROAD</p><p>RAIL</p><p>AIR</p><p>SHIP</p><p>IN_TRANSIT]</p>                      | Mandatory. Transport Mode                                             |
| RemainingDistance                           | Number    | NA                                                                                  | Mandatory. Remaining Distance                                         |
| FromPincode                                 | Number    | 2 Digits                                                                            | Mandatory. From Pincode                                               |
| ConsignmentStatus                           | Enum      | <p>[MOVEMENT</p><p>TRANSIT]</p><p><br></p>                                          | Mandatory. Consignment Status                                         |
| TransitType                                 | Enum      | <p>[ROAD</p><p>WAREHOUSE</p><p>OTHERS</p><p>NONE]</p><p><br></p>                    | Optional. Transit Type                                                |
| AddressLine1                                | String    | NA                                                                                  | Optional. Address 1                                                   |
| AddressLine2                                | String    | NA                                                                                  | <p>Optional. Address 1</p><p><br></p>                                 |
| AddressLine3                                | String    | NA                                                                                  | <p>Optional. Address 3</p><p><br></p>                                 |

### Response Status Codes

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

### Response Schema

| Parameter   | Data Type | Field Validations | Description                                                                      |
| ----------- | --------- | ----------------- | -------------------------------------------------------------------------------- |
| EwbNumber   | Number    | 12 Digits         | E-Way Bill number                                                                |
| UpdatedDate | String    | NA                | Date and time of update. This will be null in case of failure.                   |
| ValidUpto   | String    | NA                | Date and time of upto which EWB is valid. This will be null in case of failure.  |
| errors      | List      | NA                | This will be null if there will be no error.                                     |

#### &#x20;Errors Object

| Parameter      | Data Type | Field Validations | Description                                                                |
| -------------- | --------- | ----------------- | -------------------------------------------------------------------------- |
| error\_code    | Number    | NA                | Error Code. If there is no error, then this field will not be present.     |
| error\_message | String    | NA                | Error message. If there is no error, then this field will not be present.  |
| error\_source  | String    | NA                | Error Source. If there is no error, then this field will not be present.   |

### Sample Request and Response

#### Request

```json
{
    "EwbNumber": 251009955228,
    "FromPlace": "Bangalore",
    "FromState": "29",
    "FromPincode": "560037",
    "ReasonCode": "OTHERS",
    "ReasonRemark": "extend validity",
    "TransDocNo": "TD-3",
    "TransDocDt": "22/02/2023",
    "TransMode": "ROAD",
    "RemainingDistance": "20",
    "ConsignmentStatus": "MOVEMENT",
    "VehNo": "MH45YY2356"
}
```

#### Response - Success:

**HTTP Status Code - 200**

```json
{
    "EwbNumber": 251009955228,
    "UpdatedDate": "24/02/2023 01:14:00 PM",
    "ValidUpto": "25/02/2023 11:59:00 PM",
    "errors": null
}
```

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

**HTTP Status Code - 200**

```json
{
    "errors": {
        "error_code": "7001",
        "error_message": "Invalid Vehicle Number, Vehicle number length should be between 7 and 15 ",
        "error_source": "CLEARTAX"
    }
}
```

### API Validations

Currently there are no known validations for this API.

### API Constraints

1. The Validity of EWB can be extended only by the current transporter. If the transporter is not assigned, then the generator can update.
2. The validity of EWB can be extended between 8 hours before expiry time and 8 hours after expiry time.
