# Generate E-Waybill for Non-IRN documents

You can generate an EWB for the document types that are not eligible for IRN by sending a **`PUT`** request to E-Invoicing API with the following request headers.

### Request Method

PUT

### Request URL

```
{{HOST}}/einv/v3/ewaybill/generate
```

### Request Headers

<table><thead><tr><th width="221.77027027027032">PARAMETER</th><th width="150">TYPE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>X-Cleartax-Auth-Token</td><td>String</td><td>Mandatory. The auth token generated from ClearTax user id and password.</td></tr><tr><td>gstin</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.&#x20;

### Request Query Params

There are no query parameters for this API.&#x20;

### Request Body

<table><thead><tr><th>PARAMETER</th><th width="150">TYPE</th><th>VALIDATIONS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>DocumentNumber</td><td>String</td><td>Max Length 16</td><td>Mandatory. Document number</td></tr><tr><td>DocumentType</td><td>String</td><td><p>INV = Tax Invoice</p><p>BOS = Bill of supply</p><p>BOE = Bill of entry</p><p>CHL = Delivery challan</p><p>OTH = Other</p></td><td>Mandatory Document type</td></tr><tr><td>DocumentDate</td><td>String</td><td>Should in format dd/mm/yyyyy</td><td>Mandatory. Document date</td></tr><tr><td>SupplyType</td><td>String</td><td><p>Inward</p><p>Outward</p></td><td>Mandatory. Supply Type</td></tr><tr><td>SubSupplyTyp</td><td>String</td><td><p>1 or Supply</p><p>2 or Import</p><p>3 or Export</p><p>4 or JOB_WORK</p><p>5 or OWN_USE</p><p>6 or JOB_WORK_RETURNS</p><p>7 or SALES_RETURN</p><p>8 or OTH</p><p>9 or SKD_CKD</p><p>10 or LINES_SALES</p><p>11 or RECIPIENT_NOT_KNOWN</p><p>12 or EXHIBITION_OR_FAIRS</p></td><td><p>Mandatory. Sub Supply Type</p><p></p></td></tr><tr><td>SubSupplyTypeDesc</td><td>String</td><td>NA</td><td>Other Sub Supply Description</td></tr><tr><td>TransactionType</td><td>String</td><td><p>1 or Regular</p><p>2 or Bill to-ship to</p><p>3 or Bill from-dispatch from</p><p>4 or Combination</p></td><td>Mandatory. Transaction type\</td></tr><tr><td>TotalInvoiceAmount</td><td>String</td><td><p>Total Invoice value = Taxable amount of the items +</p><p>                     TotalCgstValue + TotalSgstValue + TotalIgstValue</p><p>                     TotalCessAmount + TotalCessNonAdvolAMount +</p><p>                     Other charges at Doc level</p><p>(with a grace range of +/- 2)</p></td><td>Mandatory. Total invoice value</td></tr><tr><td>TotalCgstAmount</td><td>Decimal (18,2)</td><td>NA</td><td>Conditional.  Total CGST value</td></tr><tr><td>TotalSgstAmoun</td><td>Decimal (18,2)</td><td>NA</td><td>Conditional. Total SGST value</td></tr><tr><td>TotalIgstAmount</td><td>Decimal (18,2)</td><td>NA</td><td>Conditional. Total IGST value</td></tr><tr><td>TotalCessAmount</td><td>Decimal (18,2)</td><td>NA</td><td>Optional. Total cess value</td></tr><tr><td>TotalCessNonAdvolAmount</td><td>Decimal (18,2)</td><td>NA</td><td>Optional. Cess non Advol value</td></tr><tr><td>TotalAssessableAmount</td><td>Decimal (18,2)</td><td>NA</td><td>Optional. Total assessable value</td></tr><tr><td>OtherAmount</td><td>Decimal (18,2)</td><td>NA</td><td>Optional. Other values</td></tr><tr><td>OtherTcsAmount</td><td>Decimal (18,2)</td><td>NA</td><td>Optional. TCS values</td></tr><tr><td>TransId</td><td>String</td><td>Valid GSTIN</td><td><p>Mandatory for PART-A </p><p>Transporter GSTIN or CEN (Common Enrollment Number)</p></td></tr><tr><td>TransName</td><td>String</td><td>Max Length 100</td><td>Mandatory. Transporter name</td></tr><tr><td>TransMode</td><td>String</td><td><p>Road-1</p><p>Rail-2</p><p>Air-3</p><p>Ship-4</p><p></p></td><td>Optional for PART-A otherwise Mandatory</td></tr><tr><td>Distance</td><td>Number</td><td><p>minimum: 0</p><p>maximum: 4000</p></td><td><p>Mandatory. </p><p>Distance between source and destination PIN codes.</p><p>If the value is "0" then the distance will be auto-computed by NIC based on the availability of pin-codes in NIC database. </p></td></tr><tr><td>TransDocNo</td><td>String</td><td>Max Length: 15</td><td>Optional when transport mode is ROAD. Transporter document number</td></tr><tr><td>TransDocDt</td><td>String</td><td>Should in format dd/mm/yyyyy</td><td>Optional when transport mode is ROAD. Transporter document date</td></tr><tr><td>VehNo</td><td>String</td><td>Valid vehicle number</td><td>Mandatory for transport mode ROAD.</td></tr><tr><td>VehType</td><td>String</td><td><p>REGULAR</p><p>ODC</p></td><td>Optional. Vehicle type</td></tr></tbody></table>

#### Seller, Buyer, Shipping and Dispatch Objects

**Use the below keys in the above four objects:**

| Parameter | Data Type | Field Validations                    | Description                                                           |
| --------- | --------- | ------------------------------------ | --------------------------------------------------------------------- |
| Gstin     | String    | Valid gstin Value/URP                | Mandatory. GSTIN number                                               |
| LglNm     | String    | Max length of 100                    | Mandatory. Legal name                                                 |
| TrdNm     | String    | Max length of 100                    | Optional. Trade Name                                                  |
| Addr1     | String    | Max Length 120                       | Mandatory. Address one                                                |
| Addr2     | String    | Max Length 120                       | Optional. Address two                                                 |
| Loc       | String    | Max length 50                        | Mandatory. location                                                   |
| Pin       | Integer   | valid Pincode                        | Optional if dispatch details are present otherwise mandatory. Pincode |
| Stcd      | String    | valid State code with max value of 2 | Mandatory. State code.                                                |

#### Line Item Objects

| Parameter    | Data Type      | Field Validations | Description                     |
| ------------ | -------------- | ----------------- | ------------------------------- |
| ProdName     | string         | NA                | Optional. Product Name          |
| ProdDesc     | string         | NA                | Optional. Product description   |
| HsnCd        | Number         | NA                | Mandatory. Hsn code             |
| Qty          | Decimal (8,2)  | NA                | Mandatory. Quantity             |
| Unit         | Text (3)       | NA                | Mandatory. Unit of measurement  |
| AssAmt       | Decimal (18,2) | NA                | Mandatory. Assessable amount    |
| CgstRt       | Decimal (6,3)  | NA                | Conditional. CGST rate          |
| CgstAmt      | Decimal (18,2) | NA                | Optional. CGST Amount           |
| SgstRt       | Decimal (6,3)  | NA                | Conditional. SGST Rate          |
| SgstAmt      | Decimal (18,2) | NA                | Optional. SGST Amount           |
| IgstRt       | Decimal (6,3)  | NA                | Conditional. IGST Rate          |
| IgstAmt      | Decimal (18,2) | NA                | Optional. Igst Amount           |
| CesRt        | Decimal (6,3)  | NA                | Optional. Cess Rate             |
| CesAmt       | Decimal (18,2) | NA                | Optional. Cess amount           |
| OthChrg      | Decimal (18,2) | NA                | Optional. Other charges         |
| CesNonAdvAmt | Decimal (18,2) | NA                | Optional. cess non advol amount |

**Refer to the below link for Supply Type - Document Type mapping:**&#x20;

{% content-ref url="../../../learn-e-waybill-api-basics" %}
[learn-e-waybill-api-basics](../../../learn-e-waybill-api-basics)
{% endcontent-ref %}

### 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 Payload                                            |
| 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

| Parameter       | Data Type | Field Validations     | Description                                                  |
| --------------- | --------- | --------------------- | ------------------------------------------------------------ |
| owner\_id       | String    | NA                    | Its value will be null.                                      |
| ewb\_status     | String    | Enum: GENERATED, null | Status of generation of EWB                                  |
| ewb\_request    | Object    | NA                    | EWB requests details provided in input.                      |
| govt\_response  | Object    | NA                    | Govt response containing EWB generation details.             |
| transaction\_id | String    | NA                    | Unique ID created by ClearTax for troubleshooting purposes.  |

#### Govt response object

| Parameter    | Data Type | Field Validations | Description                           |
| ------------ | --------- | ----------------- | ------------------------------------- |
| Success      | Boolean   | ‘Y’, ‘N’          | If Success or Failure.                |
| Status       | String    | Enum: Generated   | Generation Status of EWB              |
| EwbNo        | Number    | NA                | E-Way bill Number.                    |
| EwbDt        | String    | NA                | E-Way bill generation date and time.  |
| EwbValidTill | String    | NA                | E-Way bill expiry date and time.      |

### Sample Request & Response

#### Request

{% tabs %}
{% tab title="PART A & B" %}
```json
{
    "DocumentNumber": "STEST0004",
    "DocumentType": "INV",
    "DocumentDate": "12/10/2023",
    "SupplyType": "OUTWARD",
    "SubSupplyType": "SUPPLY",
    "SubSupplyTypeDesc": "TEST",
    "TransactionType": "Combination",
    "BuyerDtls": {
        "Gstin": "29AWGPV7107B1Z1",
        "LglNm": "XYZ company pvt ltd",
        "TrdNm": "XYZ Industries",
        "Addr1": "7th block, kuvempu layout",
        "Addr2": "kuvempu layout",
        "Loc": "GANDHINAGAR",
        "Pin": 562160,
        "Stcd": "29"
    },
    "SellerDtls": {
        "Gstin": "29AAFCD5862R000",
        "LglNm": "NIC company pvt ltd",
        "TrdNm": "NIC Industries",
        "Addr1": "5th block, kuvempu layout",
        "Addr2": "kuvempu layout",
        "Loc": "GANDHINAGAR",
        "Pin": 560027,
        "Stcd": "29"
    },
    "ExpShipDtls": {
        "LglNm": "ABCD",
        "Addr1": "322 & 323 THIRUVALLUVAR NAGAR NEELI",
        "Addr2": null,
        "Loc": "COIMBATORE",
        "Pin": 641033,
        "Stcd": "33"
    },
    "DispDtls": {
        "Nm": "XYZ",
        "Addr1": "322 & 323 THIRUVALLUVAR NAGAR",
        "Addr2": "2nd cross, apavu nagar",
        "Loc": "Hosur",
        "Pin": 635109,
        "Stcd": "33"
    },
    "ItemList": [
        {
            "ProdName": "Rice",
            "ProdDesc": "test",
            "HsnCd": "1001",
            "Qty": 1,
            "Unit": "BAG",
            "AssAmt": 100,
            "CgstRt": 9,
            "CgstAmt": 9,
            "SgstRt": 9,
            "SgstAmt": 9,
            "IgstRt": 0,
            "IgstAmt": 0,
            "CesRt": 0,
            "CesAmt": 0,
            "OthChrg": 0,
            "CesNonAdvAmt": 0,
            "LineItemCustomFields": {
                "test": "0100"
            }
        }
    ],
    "TotalInvoiceAmount": 118,
    "TotalCgstAmount": 9,
    "TotalSgstAmount": 9,
    "TotalIgstAmount": 0,
    "TotalCessAmount": 0,
    "TotalCessNonAdvolAmount": 0,
    "TotalAssessableAmount": 100,
    "OtherAmount": 0,
    "OtherTcsAmount": 0,
    "TransId": "29AAACW6288M1ZH",
    "TransName": "TRANSPORT",
    "TransMode": "ROAD",
    "Distance": 0,
    "TransDocNo": "TEST-123",
    "TransDocDt": "12/10/2023",
    "VehNo": "KA123456",
    "VehType": "REGULAR",
    "CustomFields": {
        "company number": "104"
    }
}
```
{% endtab %}

{% tab title="PART A" %}
```json
{
    "DocumentNumber": "STEST0004",
    "DocumentType": "INV",
    "DocumentDate": "12/10/2023",
    "SupplyType": "OUTWARD",
    "SubSupplyType": "SUPPLY",
    "SubSupplyTypeDesc": "TEST",
    "TransactionType": "Combination",
    "BuyerDtls": {
        "Gstin": "29AWGPV7107B1Z1",
        "LglNm": "XYZ company pvt ltd",
        "TrdNm": "XYZ Industries",
        "Addr1": "7th block, kuvempu layout",
        "Addr2": "kuvempu layout",
        "Loc": "GANDHINAGAR",
        "Pin": 562160,
        "Stcd": "29"
    },
    "SellerDtls": {
        "Gstin": "29AAFCD5862R000",
        "LglNm": "NIC company pvt ltd",
        "TrdNm": "NIC Industries",
        "Addr1": "5th block, kuvempu layout",
        "Addr2": "kuvempu layout",
        "Loc": "GANDHINAGAR",
        "Pin": 560027,
        "Stcd": "29"
    },
    "ExpShipDtls": {
        "LglNm": "ABCD",
        "Addr1": "322 & 323 THIRUVALLUVAR NAGAR NEELI",
        "Addr2": null,
        "Loc": "COIMBATORE",
        "Pin": 641033,
        "Stcd": "33"
    },
    "DispDtls": {
        "Nm": "XYZ",
        "Addr1": "322 & 323 THIRUVALLUVAR NAGAR",
        "Addr2": "2nd cross, apavu nagar",
        "Loc": "Hosur",
        "Pin": 635109,
        "Stcd": "33"
    },
    "ItemList": [
        {
            "ProdName": "Rice",
            "ProdDesc": "test",
            "HsnCd": "1001",
            "Qty": 1,
            "Unit": "BAG",
            "AssAmt": 100,
            "CgstRt": 9,
            "CgstAmt": 9,
            "SgstRt": 9,
            "SgstAmt": 9,
            "IgstRt": 0,
            "IgstAmt": 0,
            "CesRt": 0,
            "CesAmt": 0,
            "OthChrg": 0,
            "CesNonAdvAmt": 0,
            "LineItemCustomFields": {
                "test": "0100"
            }
        }
    ],
    "TotalInvoiceAmount": 118,
    "TotalCgstAmount": 9,
    "TotalSgstAmount": 9,
    "TotalIgstAmount": 0,
    "TotalCessAmount": 0,
    "TotalCessNonAdvolAmount": 0,
    "TotalAssessableAmount": 100,
    "OtherAmount": 0,
    "OtherTcsAmount": 0,
    "TransId": "29AAACW6288M1ZH",
    "TransName": "TRANSPORT",
    "TransMode": null,
    "Distance": 0,
    "TransDocNo": "TEST-123",
    "TransDocDt": "12/10/2023",
    "VehNo": null,
    "VehType": null,
    "CustomFields": {
        "company number": "104"
    }
}
```
{% endtab %}
{% endtabs %}

#### Response - **Success:**

**HTTP Status Code: 200 OK**

```json
{
    "owner_id": null,
    "ewb_status": "GENERATED",
    "ewb_request": {
        "TransId": "29AAACW6288M1ZH",
        "TransName": "ABC",
        "TransMode": "ROAD",
        "Distance": 0,
        "TransDocNo": "TEST-123",
        "TransDocDt":  "12/10/2023",
        "VehNo": "KA123456",
        "VehType": "REGULAR",
        "DispDtls": {
            "Addr1": "322 & 323 THIRUVALLUVAR NAGAR",
            "Addr2": "2nd cross, apavu nagar",
            "Loc": "Hosur",
            "Pin": 635109,
            "Stcd": "33"
        },
        "ExpShipDtls": {
            "CustomerName": "ABC",
            "Addr1": "322 & 323 THIRUVALLUVAR NAGAR NEELI",
            "Addr2": "Test2",
            "Loc": "COIMBATORE",
            "Pin": 641033,
            "Stcd": "33"
        },
        "BuyerDtls": {
            "Gstin": "29AAFCD5862R1ZR",
            "TrdNm": "XYZ Industries",
            "Addr1": "7th block, kuvempu layout",
            "Addr2": "kuvempu layout",
            "Loc": "GANDHINAGAR",
            "Pin": 562160,
            "Stcd": "29"
        },
        "SellerDtls": {
            "Gstin": "07AAFCD5862R007",
            "TrdNm": "NIC Industries",
            "Addr1": "5th block, kuvempu layout",
            "Addr2": "kuvempu layout",
            "Loc": "GANDHINAGAR",
            "Pin": 110001,
            "Stcd": "07"
        },
        "DocumentNumber": "STEST0002",
        "DocumentType": "CHL",
        "DocumentDate": "12/10/2023",
        "SupplyType": "OUTWARD",
        "SubSupplyType": "Job Work",
        "SubSupplyTypeDesc": "TEST",
        "TransactionType": "Combination",
        "ItemList": [
            {
                "ProdName": "Rice",
                "ProdDesc": "test",
                "HsnCd": "1001",
                "Qty": 1.000,
                "Unit": "BAG",
                "AssAmt": 100.00,
                "CgstRt": 0.00,
                "CgstAmt": 0.00,
                "SgstRt": 0.00,
                "SgstAmt": 0.00,
                "IgstRt": 0.00,
                "IgstAmt": 0.00,
                "CesRt": 0.00,
                "CesAmt": 0.00,
                "CesNonAdvAmt": 0.00,
                "OthChrg": 0.00,
                "OthChrgTcs": null,
                "LineItemCustomFields": null
            }
        ],
        "TotalInvoiceAmount": 100.00,
        "IsSupplyToOrSezUnit": null,
        "TotalCgstAmount": 0.00,
        "TotalSgstAmount": 0.00,
        "TotalIgstAmount": 0.00,
        "TotalCessAmount": 0.00,
        "TotalCessNonAdvolAmount": 0.00,
        "TotalAssessableAmount": 100.00,
        "OtherAmount": 0.00,
        "OtherTcsAmount": 0.00,
        "CustomFields": null
    },
    "govt_response": {
        "Success": "Y",
        "Status": "GENERATED",
        "EwbNo": 741008837974,
        "EwbDt": "2023-11-03 12:37:00",
        "EwbValidTill": "2023-11-05 23:59:00",
        "Alert": ", Distance between these two pincodes is 315, "
    },
    "transaction_id": "07AAFCD5862R007_WAREWB67_CHL_2023"
}

```

#### Response - **Failure:**

**HTTP Status Code: 200 OK**

```json
{
    "owner_id": null,
    "ewb_status": null,
    "ewb_request": {
        "TransId": "29AAACW6288M1ZH",
        "TransName": "ABC",
        "TransMode": "ROAD",
        "Distance": 0,
        "TransDocNo": null,
        "TransDocDt": null,
        "VehNo": "KA123456",
        "VehType": "REGULAR",
        "DispDtls": {
            "Addr1": "322 & 323 THIRUVALLUVAR NAGAR",
            "Addr2": "2nd cross, apavu nagar",
            "Loc": "Hosur",
            "Pin": 635109,
            "Stcd": "33"
        },
        "ExpShipDtls": {
            "CustomerName": "ABC",
            "Addr1": "322 & 323 THIRUVALLUVAR NAGAR NEELI",
            "Addr2": "Test2",
            "Loc": "COIMBATORE",
            "Pin": 641033,
            "Stcd": "33"
        },
        "BuyerDtls": {
            "Gstin": "29AAFCD5862R1ZR",
            "TrdNm": "XYZ Industries",
            "Addr1": "7th block, kuvempu layout",
            "Addr2": "kuvempu layout",
            "Loc": "GANDHINAGAR",
            "Pin": 562160,
            "Stcd": "29"
        },
        "SellerDtls": {
            "Gstin": "07AAFCD5862R007",
            "TrdNm": "NIC Industries",
            "Addr1": "5th block, kuvempu layout",
            "Addr2": "kuvempu layout",
            "Loc": "GANDHINAGAR",
            "Pin": 110001,
            "Stcd": "07"
        },
        "DocumentNumber": "WAREWB68",
        "DocumentType": "CHL",
        "DocumentDate": "12/10/2023",
        "SupplyType": "OUTWARD",
        "SubSupplyType": "Job Work",
        "SubSupplyTypeDesc": "TEST",
        "TransactionType": "Regular",
        "ItemList": [
            {
                "ProdName": "Rice",
                "ProdDesc": "test",
                "HsnCd": "1001",
                "Qty": 1.000,
                "Unit": "BAG",
                "AssAmt": 100.00,
                "CgstRt": 0.00,
                "CgstAmt": 0.00,
                "SgstRt": 0.00,
                "SgstAmt": 0.00,
                "IgstRt": 0.00,
                "IgstAmt": 0.00,
                "CesRt": 0.00,
                "CesAmt": 0.00,
                "CesNonAdvAmt": 0.00,
                "OthChrg": 0.00,
                "OthChrgTcs": null,
                "LineItemCustomFields": null
            }
        ],
        "TotalInvoiceAmount": 100.00,
        "IsSupplyToOrSezUnit": null,
        "TotalCgstAmount": 0.00,
        "TotalSgstAmount": 0.00,
        "TotalIgstAmount": 0.00,
        "TotalCessAmount": 0.00,
        "TotalCessNonAdvolAmount": 0.00,
        "TotalAssessableAmount": 100.00,
        "OtherAmount": 0.00,
        "OtherTcsAmount": 0.00,
        "CustomFields": null
    },
    "govt_response": {
        "Success": "N",
        "ErrorDetails": [
            {
                "error_code": "107",
                "error_message": "transactionType : Invalid Transaction Type. Transaction Type should be a Combination of 2 & 3 when Buyer, seller, shipping and dispatch State Codes or Pin codes are not equal. Please correct the Transaction Type value and try again",
                "error_source": "CLEARTAX"
            }
        ]
    },
    "transaction_id": null
}
```

### API Validations

Currently there are no known validations for this API.

### API Constraints&#x20;

Currently there are no known constraints for this API.
