# Update E-Waybill Part-B

You can update an PART-B of 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="238">PARAMETER</th><th>PARAM TYPE</th><th width="158">TYPE</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       |
| --------- | --------- | ----------------- | ----------------- |
| action    | String    | NA                | Mandatory = PARTB |

### Request Body

| Parameter    | Data Type | Field Validations                                                           | Description                                       |
| ------------ | --------- | --------------------------------------------------------------------------- | ------------------------------------------------- |
| EwbNumber    | Number    | 12 Digits                                                                   | Mandatory. E-Way Bill Number                      |
| VehNo        | Number    | 15 Digits                                                                   | Conditional. Vehicle Number                       |
| FromPlace    | String    | 50 Characters                                                               | Mandatory. From Place                             |
| FromState    | Number    | 2 Digits                                                                    | Mandatory. From State Code                        |
| ReasonCode   | Enum      | "BREAKDOWN", "TRANSSHIPMENT", "OTHERS", "FIRST\_TIME".                      | <p>Mandatory,Reasons to update EWB</p><p><br></p> |
| ReasonRemark | String    | 50 Characters                                                               | Mandatory. Reason Remark                          |
| TransDocNo   | String    | 15 Characters                                                               | Conditional. Transport Document Number            |
| TransDocDt   | String    | dd/mm/yyyy                                                                  | Optional. Transport Document Date                 |
| TransMode    | Enum      | <p>\[ROAD</p><p>RAIL</p><p>AIR</p><p>SHIP</p><p>IN\_TRANSIT]</p><p><br></p> | Mandatory. Transport Mode                         |
| VehType      | Enum      | <p>\[Regular</p><p>ODC]</p><p><br></p>                                      | Optional. Vehicle Type                            |

### 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                                                    |
| 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    | <p><br>NA</p>     | 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.                                    |

#### 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":111009343844,
"FromPlace": "Bangalore",
"FromState": "29",
"ReasonCode": "OTHERS",
"ReasonRemark": "partb",
"TransDocNo": "TD-2",
"TransDocDt": "03/09/2021",
"TransMode": "ROAD",
"DocumentNumber": "RLK115",
"DocumentType": "INV",
"DocumentDate": "03/09/2021",
"VehicleType": "REGULAR",
"VehNo": "MH45YY2356"
}
```

#### Response - Success

**HTTP Status Code - 200**

```json
{
    "EwbNumber": 111009343844,
    "UpdatedDate": "03/09/2021 06:49:00 PM",
    "ValidUpto": "14/09/2021 11:59:00 PM",
    "errors": null
}
```

#### Response - Failure

**HTTP Status Code - 200**

```json
{
    "EwbNumber": 111011782639,
    "UpdatedDate": null,
    "ValidUpto": null,
    "errors": [
        {
            "error_code": "107",
            "error_message": "vehicleNo : Invalid vehicle number. The vehicle number entered is not a valid one. Please correct the value and try again",
            "error_source": "CLEARTAX"
        }
    ]
}
```

### API Validations

Currently there are no known validations for this API.

### API Constraints

1. Part-B can be updated by the generator of the e-way bill, if there is no transporter, or by the assigned transporter
2. Part-B can be updated only if the e-way bill is active, that is, not cancelled
3. Part-B can be updated only if the e-way bill is within the validity period, that is, validity is not expired.
4. If vehicle is passed, the format of the vehicle number should be valid and as per the format
5. In case of road as a transportation mode, the vehicle number should be passed and transport document number is optional
6. In case of rail, air or ship as a transportation mode, the transport document number is must
