# (Deprecated) Generating E-Waybill

{% hint style="danger" %}
This API is deprecated. Please use the [E-Waybill APIs from the unified set available here](https://docs.cleartax.in/cleartax-docs/e-invoicing-api/introduction-to-e-invoicing-api).
{% endhint %}

{% hint style="success" %}
**Update: Generate E-Waybill with IRN**

Now you can generate E-Waybill with IRN from IRP using the same endpoint earlier used to generate E-Waybill from NIC.

In case you have already generated IRN for a document and you want to generate E-Waybill using the IRN, then you can provide the IRN in the below API Request Body. Wherever IRN is specified, ClearTax will internally route this request to the IRN Portal to generate E-Waybill with IRN.&#x20;

If IRN is not provided, the request will be routed to NIC to generate E-Waybill as usual.
{% endhint %}

{% hint style="info" %}
Please note that the government has made some updates in the data required for the generation of E-way bill for Import and Export cases.

Case-1: If Port and Customer billing States are the same: "seller.state" will be "Other Countries" and "seller.zip\_code" will be Port Pincode and "dispatch\_from\_state" state should be the Port State.

Case-2: If Port and Customer billing States are different :\
"seller.zip\_code " and "seller.state" has to be the Port Pincode and Port State.

Case-3: From now onwards, for export cases, In "consignee.state" and "consignee.zip\_code" the user will have to give the Port details, from where export of goods will happen. So, " consignee.state" will be Port state, and "consignee.zip\_code " will be Port Pincode.
{% endhint %}

E-Waybill is generated by submitting a single or an array of E-Waybill JSON object(s) in the request body.

#### What is the purpose of Part-A E-Way bill?

Only for recording the details about supply such as :

GSTIN of the supplier, Place of dispatch, GSTIN of recipient, Place of delivery, Document number, Document Date, Value of goods, HSN Code and Reason for Transportation (Outward supply, Job work, Inward supply, sales return, Export, import, exhibition, for own use etc.)

#### What is the purpose of Part-B E-Way bill?

For giving the goods the title for lawful movement of goods in GST by filling up the following information :

Mode of Transport (Road, Rail, Air, Ship), Vehicle Type (Regular or Over dimensional Cargo), Vehicle Number in case of Road Transportation, Transport Document Number and date,

**Who is Required to Fill Part-B of E-Way Bill?**

1. Part B can be update **by supplier** when he is transporting goods on either in his own or hired a conveyance.
2. **By Transporter and only transporter** in all cases Where the supplier has availed the service of Transporter and that the supplier has not prepared Part-A of E-way bill and he has authenticated such transporter to prepare the E-Way bill with such details forwarded by him to the transporter.

#### E-Waybill Object:

| Key                | Type       | Validations                            | Description                                                                                                                                                                                                                |
| ------------------ | ---------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                 | String     |                                        | Mandatory. Unique Transaction ID                                                                                                                                                                                           |
| **irn**            | **String** | minLength: 64	maxLength: 64            | **Optional. In case you have already generated IRN and you want to generate E-Waybill with IRN, then provide the IRN here. ClearTax will internally route this request to the IRN Portal to generate E-Waybill with IRN.** |
| transaction\_date  | String     |                                        | Mandatory. Date of transaction                                                                                                                                                                                             |
| source             | ENUM       | Possible values: USER, GOVERNMENT      | Mandatory. Source of the document.                                                                                                                                                                                         |
| document\_number   | String     | maxLength: 16                          | Mandatory. Document number                                                                                                                                                                                                 |
| type               | ENUM       | Possible values:  SALE OR PURCHASE     | Mandatory.                                                                                                                                                                                                                 |
| transport\_mode    | ENUM       | Possible Values: ROAD, RAIL, AIR, SHIP | Mandatory for part B . Leave this field blank for part A generation. Mode of Transport.                                                                                                                                    |
| transporter\_gstin | String     | <p>pattern: "\[0-9]{2}\[0-9            | A-Z]{13}"                                                                                                                                                                                                                  |

</p><p></p>                                                                                                                                                                                                                                                                                                      | Mandatory for part A. 15 Digit Transporter GSTIN/TRANSPORTER ID.                                                                                                                                                            |
| transporter\_name        | String     | maxLength: 100                                                                                                                                                                                                                                                                                                                                       | Name of Transporter.                                                                                                                                                                                                        |
| transporter\_from\_place | String     | maxLength: 50                                                                                                                                                                                                                                                                                                                                        | Transporter City.                                                                                                                                                                                                           |
| transporter\_from\_state | String     | maximum: 99                                                                                                                                                                                                                                                                                                                                          | Transporter State.                                                                                                                                                                                                          |
| transport\_doc\_number   | String     | maxLength: 15                                                                                                                                                                                                                                                                                                                                        | Transport document number. Mandatory if transportation mode is rail, air or ship. Leave this field blank for part A generation.                                                                                             |
| transport\_date          | String     | Should be greater than equal to document date                                                                                                                                                                                                                                                                                                        | Date of transport.                                                                                                                                                                                                          |
| dispatch\_from\_state    | ENUM       | <p></p><p></p><p>maximum: 99</p><p></p>                                                                                                                                                                                                                                                                                                              | Indian state                                                                                                                                                                                                                |
| sub\_supply              | ENUM       | <p>Possible values: SUPPLY</p><p></p><p>EXPORT</p><p></p><p>JOB_WORK</p><p></p><p>OWN_USE</p><p></p><p>SKD_CKD</p><p></p><p>LINE_SALES</p><p></p><p>RECIPIENT_UNKNOWN</p><p></p><p>EXHIBITION</p><p></p><p>FAIRS</p><p></p><p>SALES_RETURN</p><p></p><p>JOB_WORK_RETURNS</p><p></p><p>IMPORT</p><p></p><p>OTHERS</p><p></p> | Sub Supply Type                                                                                                                                                                                                             |
| export\_type             | String     | <p>DEEMED</p><p>SEZ_WITHOUT_IGST</p><p>SEZ_WITH_IGST</p><p>EXPORT_WITH_IGST</p><p>EXPORT_UNDER_BOND</p><p>SALE_FROM_BONDED_WH</p><p>REGULAR</p>                                                                                                                                                                                                      | Export type                                                                                                                                                                                                                 |
| sub\_supply\_desc        | String     | maxLength: 20                                                                                                                                                                                                                                                                                                                                        | Sub Supply Description (Mandatory if your sub\_supply is OTHERS)                                                                                                                                                            |
| distance                 | Number     | <4000 km                                                                                                                                                                                                                                                                                                                                             | Do not send this field if you want to auto calculate distance based on from and to pin-code.                                                                                                                                |
| vehicle\_number          | String     | <p>minLength: 7</p><p> maxLength: 15</p>                                                                                                                                                                                                                                                                                                            | Vehicle number. Mandatory for road and transport\_doc\_number is optional. Leave this field blank for part A generation.                                                                                                    |
| vehicle\_type            | String     | NA                                                                                                                                                                                                                                                                                                                                                   | Vehicle type.\[R - Regular, O - over-dimensional (cargo)]                                                                                                                                                                   |
| document\_type           | String     |                                                                                                                                                                                                                                                                                                                                                      | <p>INV -	Tax Invoice</p><p>BIL -	Bill of Supply</p><p>BOE-	Bill of Entry</p><p>CHL-	Delivery Challan</p><p>OTH-	Others</p>                                                                                             |
| seller                   | Object     |                                                                                                                                                                                                                                                                                                                                                      | Mandatory. Person object of the seller                                                                                                                                                                                      |
| receiver                 | Object     |                                                                                                                                                                                                                                                                                                                                                      | Mandatory. Person object of the receiver                                                                                                                                                                                    |
| consignee                | Object     |                                                                                                                                                                                                                                                                                                                                                      | Person object of the consignee                                                                                                                                                                                              |
| transaction\_type        | ENUM       |                                                                                                                                                                                                                                                                                                                                                      | <p>REGULAR, BILLTO, SHIPTO, Bill From - Dispatch From,</p><p>COMBINATION</p>                                                                                                                                               |
| line\_items              | Array      |                                                                                                                                                                                                                                                                                                                                                      | Array of Line Item objects                                                                                                                                                                                                  |
| other\_val               | String     |                                                                                                                                                                                                                                                                                                                                                      | Other charges in the invoice Eg: TCS value                                                                                                                                                                                  |

#### Line Item Object:

{% hint style="info" %}
Number of items per E Way Bill is limited to 250
{% endhint %}

| Key                         | Type   | Description                                              |
| --------------------------- | ------ | -------------------------------------------------------- |
| item\_code                  | String | Client Item/SKU code                                     |
| gst\_code                   | String | HSN code of the Product                                  |
| gst\_type                   | ENUM   | GOODS or SERVICES                                        |
| description                 | String | Product name (not printed)                               |
| notes                       | String | Item description                                         |
| unit\_price                 | Number | Item unit price in rupees                                |
| unit\_price\_including\_tax | Number | Item unit price including tax in rupees                  |
| unit\_of\_measurement       | String | Item unit of measurement                                 |
| item\_id                    | String | <p>Optional: Item ID in ClearTax</p><p>Default: null</p> |
| serial\_number              | Number | Line item serial number, starting from 1                 |
| quantity                    | Number | Line item quantity                                       |
| discount\_rate              | Number | Line item discount rate                                  |
| discount                    | Number | Line item discount value                                 |
| taxable\_val                | Number | Line item taxable value                                  |
| cgst\_rate                  | Number | Line item CGST rate. Should be equal to SGST             |
| cgst\_val                   | Number | Line item CGST value                                     |
| sgst\_rate                  | Number | Line item SGST rate. Should be equal to CGST             |
| sgst\_val                   | Number | Line item SGST value                                     |
| igst\_rate                  | Number | Line item IGST rate                                      |
| igst\_val                   | Number | Line item IGST value                                     |
| cess\_rate                  | Number | Line item cess rate                                      |
| cess\_val                   | Number | Line item cess value                                     |
| total\_val                  | Number | Line item total value                                    |

#### Person object: (Seller, Receiver, Consignee)

| Key           | Type    | Description                                                                                                                                                      |
| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name          | String  | Name of person                                                                                                                                                   |
| gstin         | String  | GSTIN of person                                                                                                                                                  |
| address1      | String  | Address Line 1 of person                                                                                                                                         |
| address2      | String  | Address Line 2 of person                                                                                                                                         |
| city          | String  | City of person                                                                                                                                                   |
| state         | String  | State of person Refer [State Master](https://cleartax.gitbook.io/cleartax-for-developers/gst-api/gst-api-reference/resources-and-masters/place-is-supply-master) |
| zip\_code     | Integer | Zip code of person                                                                                                                                               |
| country       | String  | Country of person                                                                                                                                                |
| phone\_number | String  | Phone number of person                                                                                                                                           |

#### Errors Object

| Key          | Type   | Description               |
| ------------ | ------ | ------------------------- |
| errorMessage | String | Error message description |
| errorCode    | String | Error code.               |

## Generate an E-Waybill

E-Waybill can be generated by submitting a **PUT** request to the E-Waybill API with the following request headers.

URL query string:

```
{{HOST}}/v0.1/taxable_entities/{{TAXABLE_ENTITY_ID}}/ewaybill/{{ID}}?activity_type=GENERATE_EWB
```

Request Parameters:

| Parameters            | Parameter Type | Type   | Description                                                                |
| --------------------- | -------------- | ------ | -------------------------------------------------------------------------- |
| X-Cleartax-Auth-Token | Header         | String | Mandatory. The auth token generated from ClearTax user id and password.    |
| taxable\_entity\_id   | Path           | String | Required. This is the unique ID associated with the GSTIN in your account. |
| id                    | Path           | String | Required. Unique Transaction ID.                                           |
| activity\_type        | Query          | ENUM   | \[GENERATE\_EWB]                                                           |

#### Sample Request:

```
https://ewbbackend-preprodpub-http.internal.cleartax.co/gst/v0.1/taxable_entities/bf557750-936e-4209-ac46-f3e8426d4780/ewaybill/DOC512?activity_type=GENERATE_EWB
```

{% tabs %}
{% tab title="Part A Generation" %}

```javascript
{
     
     "id": "testd123",
     "irn": "c224f676c458287e3af1d7955a6360d3dc683aa0eb5356d46db5de65b7d4dba0",
     "transaction_date": "27/09/2018",
     "return_period": "062018",
     "source": "USER",
     "total_taxable_val": 150024.85,
     "total_igst_val": "",
     "total_cgst_val": 9001.45,
     "total_sgst_val": 9001.45,
     "total_val": 168027.76,
     "place_of_supply": "karnataka",
     "is_canceled": false,
     "branch_id": "5ae1bbae-27e2-48e6-8d5b-0fa80c0ee8ca",
     "document_number": "2080660",
     "type": "SALE",
     "seller": {
       "gstin": "29AEKPV7203E1Z9",
       "address1": "Maharashtra",
       "address2": "Maharashtra",
       "city": "Bangalore",
       "state": "KARNATAKA",
       "zip_code": 560068,
       "country": null,
       "phone_number": null
     },
     "receiver": {
         "name": "BILLING NAME",
       "gstin": "29AAACW6288M1ZH",
       "address1": "BILLING ADDRESS, 1 DR BURMAN MARG,UPSIDE IND. AREA SAHIBABAD-201010, GHAZIABAD UTTER PRADESH",
       "address2": "BILLING ADDRESS 2",
       "city": "Bangalore",
       "state": "KARNATAKA",
       "zip_code": 560068,
       "country": null,
       "phone_number": null
     },
    "consignee": {
     
	"name": "SHIPPING NAME",
       "gstin": "29AAACW4202F1ZM",
       "address1": "SHIPPING ADDRESS, 1 DR BURMAN MARG,UPSIDE IND. AREA SAHIBABAD-201010, GHAZIABAD UTTER PRADESH",
       "address2": "SHIPPING ADDRESS 1",
       "city": "Bangalore",
       "state": "KARNATAKA",
       "zip_code": 560068,
       "country": null,
       "phone_number": null
     },
     
     "transport_mode": "",
     "transporter_gstin": "29AAACW6288M1ZH",
     "transporter_from_place": "",
     "transporter_from_state": null,
	 "dispatch_from_state": "KARNATAKA",
     
   
     "sub_supply": "SUPPLY",
     "line_items": [
       {
         "item_code": null,
         "gst_code": "61091000",
         "gst_type": "GOODS",
         "description": "READYMADE GARMENT",
         "notes": null,
         "unit_price": null,
         "unit_price_including_tax": null,
         "unit_of_measurement": "BOX",
         "item_id": null,
         "serial_number": 1,
         "quantity": 82,
         "discount_rate": null,
         "discount": null,
         "taxable_val": 150024.85,
         "cgst_rate": 2.5,
         "cgst_val": 9000.45,
         "sgst_rate": 2.5,
         "sgst_val": 9000.45,
         "igst_rate": null,
         "igst_val": null,
         "cess_rate": null,
         "cess_val": null,
         "total_val": 168027.76,
         "tags": null
       }
     ],
     "distance": 30,
     "vehicle_number": "",
     "document_type": "INV",
     "override_ewb_status": false,
     "active": false
   }

```

{% endtab %}

{% tab title="Part A and Part B" %}

```javascript
{  
  "id":"DOC512",
  "irn": "c224f676c458287e3af1d7955a6360d3dc683aa0eb5356d46db5de65b7d4dba0",
  "transaction_date":"15/03/2019",
  "source":"USER",
  "document_number":"DOC512",
  "type":"OUTWARD",
  "transport_mode":"ROAD",
  "dispatch_from_state":"HARYANA",
  "sub_supply":"Supply",
  "distance":"30",
  "vehicle_number":"HR36G3784",
  "document_type":"Tax Invoice",
  "seller":{  
    "address1":"KHEWAT 220/288 MUSTATIL 34,",
    "address2":"KILA7/2(O-7),SIKRI PIYALA ROAD",
    "city":"FARIDABAD",
    "gstin":"29AEKPV7203E1Z9",
    "name":"SHOPPERS STOP LIMITED",
    "state":"HARYANA",
    "zip_code":"121102"
  },
  "receiver":{  
    "address1":"LOGIX CITY CENTRE",
    "address2":"BW 58 SECTOR 32",
    "city":"NOIDA",
    "gstin":"29AAACW6288M1ZH",
    "name":"SHOPPERS STOP LIMITED",
    "state":"UTTAR PRADESH",
    "zip_code":"201301"
  },
  "consignee":{  
    "city":"NOIDA",
    "state":"UTTAR PRADESH",
    "zip_code":"201301"
  },
  "line_items":[  
    {  
      "cess_rate":"0",
      "cess_val":"0",
      "cgst_rate":"0",
      "cgst_val":"0",
      "description":"OTHER FURNITURE AND PARTS THEREOF -OTHER WOODEN FURNITURE",
      "gst_code":"9403",
      "igst_rate":"18.0000",
      "igst_val":"1716.5459",
      "item_code":"OTHER FURNITURE AND PARTS THER",
      "quantity":"7",
      "serial_number":"1",
      "sgst_rate":"0",
      "sgst_val":"0",
      "taxable_val":"9536.366",
      "unit_of_measurement":"NUMBERS"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### Sample Response:

{% tabs %}
{% tab title="200" %}

```javascript
{
    "ewb_number": "151001638120",
    "ewb_generated_date": "04-04-2019 22:06:00",
    "ewb_valid_from_date": "04-04-2019 22:06:00",
    "ewb_due_date": "05-04-2019 23:59:00",
    "ewb_govt_sync_status": "COMPLETE",
    "ewb_status": "GENERATED",
    ...
    E-Waybill object
    ...
}
```

{% endtab %}

{% tab title="400" %}

```javascript
{
    "errors": {
        "err_1": {
            "code": "400",
            "message": "E-Way bill id in url did not match with payload id",
            "error_group_code": 0,
            "error_id": 0
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Generate many E-Waybills

E-Waybill can be generated by submitting a **PUT** request to the E-Waybill API with the following request headers.

#### URL query string:

```
{{HOST}}/v0.1/taxable_entities/{{TAXABLE_ENTITY_ID}}/ewaybills_v2?activity_type=GENERATE_EWB
```

#### Request Parameters:

| Parameters            | Parameter Type | Type   | Description                                                                |
| --------------------- | -------------- | ------ | -------------------------------------------------------------------------- |
| X-Cleartax-Auth-Token | Header         | String | Mandatory. The auth token generated from ClearTax user id and password.    |
| taxable\_entity\_id   | Path           | String | Required. This is the unique ID associated with the GSTIN in your account. |
| -                     | Body           | Array  | Required. Array of E-Waybill Objects                                       |

#### Sample Request:

```
https://ewbbackend-preprodpub-http.internal.cleartax.co/gst/v0.1/taxable_entities/269ea15f-5e27-4203-bb11-3bb911fc5724/ewaybills_v2?activity_type=GENERATE_EWB
```

```javascript
[  
  {  
    "id":"DOC512",
    "irn": "c224f676c458287e3af1d7955a6360d3dc683aa0eb5356d46db5de65b7d4dba0",
    "transaction_date":"15/03/2019",
    "source":"USER",
    "document_number":"DOC512",
    "type":"OUTWARD",
    "transport_mode":"ROAD",
    "dispatch_from_state":"HARYANA",
    "sub_supply":"Supply",
    "distance":"30",
    "vehicle_number":"HR36G3784",
    "document_type":"Tax Invoice",
    "seller":{  
      "address1":"KHEWAT 220/288 MUSTATIL 34,",
      "address2":"KILA7/2(O-7),SIKRI PIYALA ROAD",
      "city":"FARIDABAD",
      "gstin":"29AEKPV7203E1Z9",
      "name":"SHOPPERS STOP LIMITED",
      "state":"HARYANA",
      "zip_code":"121102"
    },
    "receiver":{  
      "address1":"LOGIX CITY CENTRE",
      "address2":"BW 58 SECTOR 32",
      "city":"NOIDA",
      "gstin":"29AAACW6288M1ZH",
      "name":"SHOPPERS STOP LIMITED",
      "state":"UTTAR PRADESH",
      "zip_code":"201301"
    },
    "consignee":{  
      "city":"NOIDA",
      "state":"UTTAR PRADESH",
      "zip_code":"201301"
    },
    "line_items":[  
      {  
        "cess_rate":"0",
        "cess_val":"0",
        "cgst_rate":"0",
        "cgst_val":"0",
        "description":"OTHER FURNITURE AND PARTS THEREOF -OTHER WOODEN FURNITURE",
        "gst_code":"9403",
        "igst_rate":"18.0000",
        "igst_val":"1716.5459",
        "item_code":"OTHER FURNITURE AND PARTS THER",
        "quantity":"7",
        "serial_number":"1",
        "sgst_rate":"0",
        "sgst_val":"0",
        "taxable_val":"9536.366",
        "unit_of_measurement":"NUMBERS"
      }
    ]
  }
]

```

#### Sample Response:

{% tabs %}
{% tab title="200" %}

```javascript
[
    {
        "id": "DOC512",
        "status": true,
        "data": {
            "ewb_number": "151001638120",
            "ewb_generated_date": "04-04-2019 22:06:00",
            "ewb_valid_from_date": "04-04-2019 22:06:00",
            "ewb_due_date": "05-04-2019 23:59:00",
            "ewb_govt_sync_status": "COMPLETE",
            "ewb_status": "GENERATED",
            ...
            E-Waybill object
            ...
        },
        "errorResponse": null,
        "error_msgs": null
    }
]
```

{% endtab %}

{% tab title="200 (with errors)" %}

```javascript
[
    {
        "id": "DOC512",
        "status": false,
        "data": {E-Waybill object},
        "errorResponse": {error response object},
        "error_msgs": "Cannot update an EWay Bill which is already generated and has no transporter updates made in it."
    }
]
```

{% endtab %}
{% endtabs %}
