# Update EWB Status from NIC

This endpoint will sync the latest details of an EWB (IRN and non-IRN documents) from the NIC portal to cleartax.

### Request Method

POST

### Request URL

```
{{HOST}}/einv/v1/ewaybill/update-status?ewb_number={{ewb_number}}
```

### Request Headers

| Parameter             | Data Type | Field Validations | Description                                                                                                                                                                                          |
| --------------------- | --------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| X-Cleartax-Auth-Token | Header    | String            | Mandatory. The auth token generated from ClearTax user id and password. [Know how.](https://docs.cleartax.in/cleartax-for-developers/e-invoicing-api/e-invoicing-api-reference/authentication-token) |
| gstin                 | Header    | String            | Mandatory. GSTIN number for the user                                                                                                                                                                 |

### Request Path Params

There are no path parameters for this API.

### Request Query Params

| Parameter   | Data Type | Field Validations | Description                          |
| ----------- | --------- | ----------------- | ------------------------------------ |
| ewb\_number | String    | 12 Characters     | Mandatory. E-Way bill number.        |
| irn         | String    | 64 Characters     | Optional. Invoice reference number.  |

### Request Body

NA

### 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 authorized for the operation.                             |
| 500              | If there are any unhandled exceptions on the Clear side.                     |

### Response Schema

Error Object Details

| 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    | <p>Enum: </p><p>CLEARTAX,</p><p>GOVT. </p> | Error Source. If there is no error, then this field will not be present.   |

### Sample Request and Response

#### Request&#x20;

There will be no request body for this API.&#x20;

#### Response - Success:&#x20;

**HTTP Status Code 200 OK**

There will be no response body for this API.&#x20;

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

**HTTP Status Code 200 OK**

```json
[
    {
        "error_code": "102",
        "error_message": "EWayBill data for the selected E-Way Bills is not present",
        "error_source": "CLEARTAX"
    }
]
```

### API Validations

Currently there are no known validations for this API.

### API Constraints

EWB should be present in the ClearTax database.
