> 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-clear-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/v2/eInvoice/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 </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

| Parameter   | Data Type | Field Validations                                                                                          | Description                                                                                                                                                                                      |                   |                             |
| ----------- | --------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- | --------------------------- |
| Irn         | String    | <p>minLength: 64</p><p>maxLength: 64</p>                                                                   | Mandatory. IRN generated for the invoice.                                                                                                                                                        |                   |                             |
| TransId     | 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   | String    | <p>minLength: 3</p><p>maxLength: 100</p><p>pattern: "^(\[^\\"])\*$"</p>                                    | Optional. Name of the transporter.                                                                                                                                                               |                   |                             |
| TransMode   | 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    | Number    | <p>minimum: 1</p><p>maximum: 4000</p>                                                                      | Mandatory. Distance between source and destination PIN codes                                                                                                                                     |                   |                             |
| TransDocNo  | String    | <p>minLength: 1</p><p>maxLength: 15</p><p>pattern: "^(\[a-zA-Z0-9/-]{1,15})$"</p>                          | Optional. Transport Document Number                                                                                                                                                              |                   |                             |
| TransDocDt  | 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       | String    | <p>minLength: 4</p><p>maxLength: 20</p><p>pattern: "^(\[A-Z                                                | a-z                                                                                                                                                                                              | 0-9]{4,20})$"</p> | Conditional. Vehicle Number |
| VehType     | String    | <p>minLength: 1, maxLength: 1,</p><p>enum: \["O", "R"],</p>                                                | Conditional. Whether O-ODC or R-Regular                                                                                                                                                          |                   |                             |
| ExpShipDtls | Object    | <p><br></p>                                                                                                | Optional. [ExpShipDetails Object.](https://docs.cleartax.in/cleartax-docs/e-invoicing-api/e-invoicing-api-reference/resources-and-master/e-invoice-object.md#ship-to-details-object)             |                   |                             |
| DispDtls    | Object    | <p><br></p>                                                                                                | Optional. [Dispatch From Details Object](https://docs.cleartax.in/cleartax-docs/e-invoicing-api/e-invoicing-api-reference/resources-and-master/e-invoice-object.md#dispatch-from-details-object) |                   |                             |

### Sample Request & Response&#x20;

#### Request&#x20;

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

```

#### Response

```json
[
  {
    "TransId": "12AWGPV7107B1Z1",
    "TransName": "trans name",
    "TransMode": "1",
    "Distance": 0,
    "VehNo": "KA12ER1234",
    "VehType": "R",
    "Irn": "94b6c41efd740424c469908d0927db66d8f24d9dad78b02dab04ad1659813dc9",
    "govt_response": {
      "Success": "Y",
      "AckNo": 112310186089002,
      "AckDt": "2027-01-02 15:15:00",
      "Irn": "94b6c41efd740424c469908d0927db66d8f24d9dad78b02dab04ad1659813dc9",
      "Status": "GENERATED",
      "EwbNo": 121010274297,
      "EwbDt": "2027-01-02 15:15:00",
      "EwbValidTill": "2027-01-03 23:59:00"
    },
    "ewb_status": "GENERATED"
  }
]

```
