Eway Bill Get Call
In case of a GET call you need to do the following
Build the get string#
Refer to API Ecosystem and NIC API document to form the correct URL.
The below example is provided for version: v1.03
The get string will require adding the required parameters as follows
- Sandbox: <base_url>/gus/eway/{ewb_provider}/ewaybillapi/v1.03/ewayapi/GetEwayBill?ewbNo=171000681262
- Production: <base_url>/gus/eway/{ewb_provider}/v1.03/ewayapi/GetEwayBill?ewbNo=171000681262
Build the request payload#
The request payload will look somewhat like follows. You will need to use the authtoken that you received as a return value from the authentication call earlier. The X-ASP-* header values will need to be constructed similarly to how you constructed them in the earlier call. For clarity, a sample is provided below.
Note: When you construct the auth token, for get calls the API ACTION field (last field) will be a blank value so your X-ASP-Auth-Token will end with a colon.
Name | Value |
---|---|
gstin | <your-GSTIN> |
authtoken | <your-authorization-token> |
X-Asp-Auth-Token | <your-X-Asp-Auth-Token> |
X-Asp-Auth-Signature | <your-X-Asp-Auth-Signature> |
Response content#
The returned response content if successful will look like follows (you will receive it all in the single line. it has been indented for clarity)
{
"status":"1",
"data":"ljoyygt/ljQPAa0miD08qdb+m79vyIc49Webj5xWahO6LMx3gDsIo9pyaSfMP+UJ8+Bp4sJ462CKVF1ijcATH6jWbD+aQCxrR1YYUeIP/ac2mRYYvAPsDzCPaH5Viy5ordrLp/DCUEWf5iPQSCNwA+M2ZHyTkdxsI8Uk4ju4tD9i3ZPmb9uuhWma5pCBqcsGWU0uhm4nBr5+7j4vLNb2Ty72GGFPkUMTuuJnWLLHrDODHws69FRvGsxKg3W2WkLPpXSL7/anYLO9IvRDM47XeGe3h3wXwxylJea8flvkZHvG5IFvy6Qy9RC1Q8uLTcZrhM4lLbbrJRKrQ3tZc1jf9KKZj4hrUvKVy3iFEgVGPGh2GbUb78OmqR268oBkYIgYBmteRufCZ2s/ixWNTevPdW5eUjS8YLiWI9aZGn/2IuKC1u54GrPDG2CjpdvXXU32ERmv/zncZ3VrAoLxNLcKtoO+lls89eUopThiRw0bgmwSOmN5ZeB8A/Y4KgtG0edlGLyGCQ3hjb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KxV3lBY+4eUxtWChJLxED493FwwHeTL1AiVLAonAxtR94+8DfVhrsKH/KT4s3ytyTnW6IOr9nNYq8AeMTH249cwi3c9ILW3YK6vmUBqPGfZUCdT46WVtZiYILezxFsZRy4PP5HwpnoVeMe5xv5ogjRbgOUvIimQjYXnbDUzhu3ECuZQOYpkmxJPcZvuPisrJVgB4DoxIIQ==",
"rek":"D6W+kBBI+o8pjGPMXGWOtEoaGWq6ADlv7Y0F1tIHXxI2XYX4GIf1xQZLTO/TUlbq",
"hmac":"P11hLD1UscGrpWL8ehx705OHIWoYVZbDTs8NqBU1EEQ="
}
You now need to decrypt the rek using the earlier provided sek that you received during the authentication handshake. A decrypted rek looks somewhat like
JXLd9AXsmM24E/Tp+5CcBOX7X8m6TA3yR8OojwMtruw=
You will now use the decrypted rek to decrypt the contents of the field “data”. The decrypted content of the data field will on successful decryption provide you a JSON string like follows. Again, you get it in a single line, but it is indented below for clarity.
Sample Response Payload#
{
"ewbNo": 131001298692,
"ewayBillDate": "26/09/2018 02:40:00 PM",
"genMode": "API",
"userGstin": "29AKLPM8755F1Z2",
"supplyType": "O",
"subSupplyType": "1 ",
"docType": "INV",
"docNo": "7007-8",
"docDate": "10/09/2018",
"fromGstin": "29AKLPM8755F1Z2",
"fromTrdName": "welton",
"fromAddr1": "4556",
"fromAddr2": "hulimavu",
"fromPlace": "bannargatta",
"fromPincode": 560090,
"fromStateCode": 29,
"toGstin": "02EHFPS5910D2Z0",
"toTrdName": "test2",
"toAddr1": "Shree Nilaya",
"toAddr2": "Dasarahosahalli",
"toPlace": "Beml Nagar",
"toPincode": 560090,
"toStateCode": 29,
"totalValue": 56099,
"totInvValue": 68358,
"cgstValue": 1,
"sgstValue": 1,
"igstValue": 0,
"cessValue": 400.56,
"transporterId": "",
"transporterName": "",
"status": "ACT",
"actualDist": 2500,
"noValidDays": 25,
"validUpto": "27/09/2018 11:59:00 PM",
"extendedTimes": 0,
"rejectStatus": "N",
"actFromStateCode": 29,
"actToStateCode": 29,
"vehicleType": "R",
"transactionType": 4,
"otherValue": -10,
"cessNonAdvolValue": 400,
"itemList": [
{
"itemNo": 1,
"productId": 0,
"productName": "CEMENT",
"productDesc": " ",
"hsnCode": 25210010,
"quantity": 2,
"qtyUnit": "BOX",
"cgstRate": 0.05,
"sgstRate": 0.05,
"igstRate": 0,
"cessRate": 3,
"cessNonAdvol": 0,
"taxableAmount": 56
},
{
"itemNo": 2,
"productId": 0,
"productName": "steel",
"productDesc": "steel rods",
"hsnCode": 2402,
"quantity": 4,
"qtyUnit": "NOS",
"cgstRate": 10,
"sgstRate": 10,
"igstRate": 0,
"cessRate": 3,
"cessNonAdvol": 0,
"taxableAmount": 0
}
],
"VehiclListDetails": [
{
"updMode": "API",
"vehicleNo": "PQR1234",
"fromPlace": "Bengaluru",
"fromState": 29,
"tripshtNo": 1810002031,
"userGSTINTransin": "29AKLPM8755F1Z2",
"enteredDate": "26/09/2018 02:40:00 PM",
"transMode": "1 ",
"transDocNo": "1234",
"transDocDate": "03/05/2018",
"groupNo": "1"
},
{
"updMode": "API",
"vehicleNo": "PQR1234",
"fromPlace": "Bengaluru",
"fromState": 29,
"tripshtNo": 1110002030,
"userGSTINTransin": "29AKLPM8755F1Z2",
"enteredDate": "26/09/2018 02:40:00 PM",
"transMode": "1 ",
"transDocNo": "1234",
"transDocDate": "03/05/2018",
"vehicleType": "",
"groupNo": "0"
},
{
"updMode": "API",
"vehicleNo": "KA25AB3456",
"fromPlace": "BANGALORE SOUTH",
"fromState": 29,
"tripshtNo": 1510002029,
"userGSTINTransin": "29AKLPM8755F1Z2",
"enteredDate": "26/09/2018 02:40:00 PM",
"transMode": "1 ",
"transDocNo": "1234",
"transDocDate": "12/10/2017",
"vehicleType": "",
"groupNo": "0"
},
{
"updMode": "API",
"vehicleNo": "KA25AB3456",
"fromPlace": "BANGALORE SOUTH",
"fromState": 29,
"tripshtNo": 1810002028,
"userGSTINTransin": "29AKLPM8755F1Z2",
"enteredDate": "26/09/2018 02:40:00 PM",
"transMode": "1 ",
"transDocNo": "1234",
"transDocDate": "12/10/2017",
"vehicleType": "",
"groupNo": "0"
},
{
"updMode": "API",
"vehicleNo": "RJ191G5024",
"fromPlace": "bannargatta",
"fromState": 29,
"tripshtNo": 0,
"userGSTINTransin": "29AKLPM8755F1Z2",
"enteredDate": "26/09/2018 02:40:00 PM",
"transMode": "1 ",
"transDocNo": "12345",
"transDocDate": null,
"vehicleType": "R",
"groupNo": "0"
}
]
}
You will now need to check the hmac value to see if it is correct. On the raw JSON string you received (that’s the byte array you get post decryption) compute the hmac using the rek you got.
That computed hmac will need to be the same as the hmac that was in the returned response payload, ie in this case P11hLD1UscGrpWL8ehx705OHIWoYVZbDTs8NqBU1EEQ