> For the complete documentation index, see [llms.txt](https://docs.cleartax.in/cleartax-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cleartax.in/cleartax-docs/e-invoicing-api/e-invoicing-api-reference/rcm-self-invoicing-purchase-documents-government-schema/generate-e-waybill-by-irn.md).

# Generate E-Waybill by IRN

#### Note: For an RCMDOM self-invoice of goods, ClearTax generates the e-way bill as an inward supply (from the unregistered supplier to you). E-way bills do not apply to RCMIMP or services-only RCMDOM self-invoices

### Request Method

POST

### Request URL

```
{{HOST}}/einv/v1/govt/api/einvewb/ewaybill
```

### Request Headers

<table><thead><tr><th width="238">PARAMETER</th><th width="192">PARAM TYPE</th><th width="150">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><tr><td>invoiceType</td><td>Header</td><td>String</td><td>PURCHASE or SALE</td></tr></tbody></table>

### Request Path Params

There are no path parameters for this API.

### Request Query Params

There are no query parameters for this API.

### Request Body<br>

| Parameters | Parameter Type | Type   | Validation       | Description |
| ---------- | -------------- | ------ | ---------------- | ----------- |
| Irn        | Body           | String | <p>minLength: 64 |             |

</p><p>maxLength: 64</p>                                                            | Mandatory. IRN generated for the invoice.                        |
| TransId     | Body           | String | <p>minLength: 15</p><p>maxLength: 15</p><p>pattern: "([0-9]{2}[0-9A-Z]{13})"</p>                     | Conditional. Transporter GSTIN or CEN (Common Enrollment Number) |
| TransName   | Body           | String | <p>minLength: 3</p><p>maxLength: 100</p><p>pattern: "^([^\\\"])*$"</p>                               | Optional. Name of the transporter                                |
| TransMode   | Body           | String | <p>minLength: 1</p><p>maxLength: 1</p><p>enum: ["1", "2", "3", "4"]</p>                             | Conditional. Mode of transport (Road-1, Rail-2, Air-3, Ship-4)   |
| Distance    | Body           | Number | <p>minimum: 1</p><p>maximum: 4000</p>                                                                | Mandatory. Distance between source and destination PIN codes     |
| TransDocNo  | Body           | String | <p>minLength: 1</p><p>maxLength: 15</p><p>pattern: "^([a-zA-Z0-9\/-]{1,15})$"</p>                    | Optional. Tranport Document Number                               |
| TransDocDt  | Body           | String | <p>minLength: 10</p><p>maxLength: 10</p><p>pattern: "^[0-3][0-9]\/[0-1][0-9]\/[2][0][1-2][0-9]$"</p> | Optional. Transport Document Date                                |
| VehNo       | Body           | String | <p>minLength: 4</p><p>maxLength: 20</p><p>pattern: "^([A-Z|a-z|0-9]{4,20})$"</p>                     | Conditional. Vehicle Number                                      |
| VehType     | Body           | String | <p>minLength: 1,		maxLength: 1,</p><p>enum: ["O", "R"],</p>                                        | Conditional. Whether O-ODC or R-Regular                          |
| ExpShipDtls | Body           | Object |                                                                                                      | Optional. ExpShipDtls Object.                                    |
| DispDtls    | Body           | Object |                                                                                                      | Optional. Dispatch From Details Object                           |

### Sample Request & Response&#x20;

```json
{
  "Irn": "94b6c41efd740424c469908d0927db66d8f24d9dad78b02dab04ad1659813dc9",
  "Distance": 80,
  "TransMode": "1",
  "TransId": "12AWGPV7107B1Z1",
  "TransName": "trans name",
  "TransDocDt": "02/01/2027",
  "TransDocNo": "TRAN/DOC/11",
  "VehNo": "KA12ER1234",
  "VehType": "R"
}

```

#### Response

```json
{
  "Success": "Y",
  "EwbNo": 161008717805,
  "EwbDt": "2027-01-02 12:14:00",
  "EwbValidTill": "2027-01-03 23:59:00",
  "Remarks": "Pin-Pin calc distance: 80KM"
}

```
