Generate Eway Bill Call
URL#
Refer to API Ecosystem and NIC API document to form the correct URL.
The below example is provided for version: v1.03
The URL is the URL of the particular save call you wish to use. In this case the example will be
- Sandbox: <base_url>/gus/eway/{ewb_provider}/ewaybillapi/v1.03/ewayapi
- Production: <base_url>/gus/eway/{ewb_provider}/v1.03/ewayapi
Data#
You will need to create a JSON for the post request. A sample is provided below.
{
"supplyType": "O",
"subSupplyType": "1",
"subSupplyDesc": "",
"docType": "INV",
"docNo": "7001-8",
"docDate": "15/12/2017",
"fromGstin": "29AKLPM8755F1Z2",
"fromTrdName": "welton",
"fromAddr1": "2ND CROSS NO 59 19 A",
"fromAddr2": "GROUND FLOOR OSBORNE ROAD",
"fromPlace": "FRAZER TOWN",
"fromPincode": 560090,
"actFromStateCode": 29,
"fromStateCode": 29,
"toGstin": "02EHFPS5910D2Z0",
"toTrdName": "sthuthya",
"toAddr1": "Shree Nilaya",
"toAddr2": "Dasarahosahalli",
"toPlace": "Beml Nagar",
"toPincode": 560090,
"actToStateCode": 29,
"toStateCode": 27,
"transactionType": 4,
"otherValue": "-100",
"totalValue": 56099,
"cgstValue": 0,
"sgstValue": 0,
"igstValue": 300.67,
"cessValue": 400.56,
"cessNonAdvolValue": 400,
"totInvValue": 68358,
"transporterId": "",
"transporterName": "",
"transDocNo": "",
"transMode": "1",
"transDistance": "100",
"transDocDate": "",
"vehicleNo": "PVC1234",
"vehicleType": "R",
"itemList": [
{
"productName": "Wheat",
"productDesc": "Wheat",
"hsnCode": 1001,
"quantity": 4,
"qtyUnit": "BOX",
"cgstRate": 0,
"sgstRate": 0,
"igstRate": 3,
"cessRate": 3,
"cessNonadvol": 0,
"taxableAmount": 5609889
}
]
}
Request Payload#
The JSON you constructed above will need to be encrypted using the sek you got during the authentication call. That encrypted string becomes the “data” field in the request payload. The resultant payload will look like follows
{
"action": "GENEWAYBILL",
"data": "DdBLir97J1B/n5Q/R/Xy1OZ1mor5CZ68vBqTAg6V81onvGsuetIH40Mxr2gN77SfGsNF93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VQijcE1WvecVOJWK75SCudST2DrB/nk0cYOrwlnHaPzXzeoq2GH3GD5GMTvIp70lj3cz6J50COnUiAGhhQGUeujPXKc2/ 58SJB0zNTsoIV0HDEUiJHSCUm+rXQRTCjzT+fIjUa/dFD7wyBZFnfXTKkiGl7MJrBjJQdrK0kpv1xFIL9wlLkbirAZ6OkCpaYsn2UF+DrBruegwpuHA/cjzJj8YOmDa5kUcUHnsQ3SX Qf2+M="
}
Headers#
The sample headers will look like follows
Name | Value |
---|---|
gstin | <your-GSTIN> |
Content-Type | application/json |
authtoken | <your-authorization-token> |
X-Asp-Auth-Token | <your-X-Asp-Auth-Token> |
X-Asp-Auth-Signature | <your-X-Asp-Auth-Signature> |
Processing the response#
The sample response will look like follows. It reaches you in a single line. Indented below for clarity.
{
"status":"1",
"data":"ew0KCSJld2F5QmlsbE5vIjogMTIzNDU2Nzg5LA0KCSJld2F5QmlsbERhdGUiOiAiMTYgLyAwOSAvIDIwMTcgMTA6IDMwOiAwMCBBTSINCn0="
}
The content of the data field are actually the contents of the encrypted value of the real response payload. So decrypt it using the SEK, and you will get something along the following lines (indented for clarity)
Sample Response Payload#
{
"ewayBillNo": 123456789012,
"ewayBillDate": "25/09/2018 10:30:00 AM",
"validUpto": "26/09/2018 12.00:00 PM",
"alert": ""
}