Sample Json for GetEwayBill { "actualDist": 356, "cessValue": 127.71, "cgstValue": 85.14, "docDate": "16/12/2017", "docNo": "esf", "docType": "INV", "fromAddr1": "GHS Raliway Station Gollahalli Nelamangala", "fromAddr2": "Bangalore (Rural)", "fromGstin": "29BNMPC3977J1Z2", "fromPincode": 562123, "fromPlace": "Bangalore (Rural)", "fromStateCode": 29, "fromTrdName": "CHITRA N", "genMode": "MOB", "igstValue": 0.00, "itemList": [ { "productDesc": "", "cessRate": 3.000, "cgstRate": 2.000, "hsnCode": 1001, "igstRate": 0.000, "productId": 0, "productName": "", "qtyUnit": "KGS", "quantity": 0.00, "sgstRate": 2.000, "taxableAmount": 4257.00, “itemNo": 1, "cessAdvol": 0.00 } ], "sgstValue": 85.14, "status": "ACT", "subSupplyType": "1 ", "supplyType": "O", "toAddr1": "", "toAddr2": "", "toGstin": "29AMRPV8729L1Z1", "toPincode": 560043, "toPlace": "", "toStateCode": 29, "toTrdName": "",
GET Transin details This method provides the transporter details for a given Transporter GSTIN / Transin . The format and details of GetTransin API request is depicted in following table. URL http://ewaybill2.nic.in/ewaybillapi/v1.02/Master/GetTransporterDetails Content-Type application/json Method GET URL Parameters trn_no URL Parameters description trn_no – Transporter GSTIN or Transin for which the details are required Request Header Attributes Description client-id clientid to be provided by E-WAY BILL SYSTEM client-secret Secret to be provided by E-WAY BILL SYSTEM Gstin GSTIN of Requester(Tax payer or Transporter) authtoken Authentication token returned by the E-way bill system Response Payload Attributes Description Value Status Status of request 1 – Success ; 0 - Error JSON),rek) Response of GSTIN details Json string. Encrypt(rek,sek) Random encryption key which is encrypted using sek Hmac ( Base64(JSON data )) HMAC-SHA256 of Base64 data using AES key (rek) as HMAC Key
Sample code to generate Access token Public void GetAuthToken() { using (var reader = File.OpenText(@"D:\ConsumeEwayBillAPI\ewaybill_publickey.pem")) public_key = reader.ReadToEnd().Replace("-----BEGIN PUBLIC KEY-----","").Replace("-----END PUBLIC KEY-----","").Replace("\n",""); HttpWebRequest request = (HttpWebRequest)WebRequest.Create ("http://ewaybill2.nic.in/ewaybillapi/v1.02/Authenticate"); request.Method = "POST"; request.KeepAlive = true; request.AllowAutoRedirect = false; request.Accept = "*/*"; request.ContentType = "application/json"; request.Headers.Add("client-id", "test_clientid"); request.Headers.Add("client-secret", "test_client_secret"); request.Headers.Add("gstin", "testgstin"); string encPassword = Encrypt("testpwd", public_key); byte[] _aeskey = encdec.generateSecureKey(); //common.RandomString(32); // string straesKey = Convert.ToBase64String(_aeskey); string encAppKey = encdec.Encrypt(_aeskey, public_key); RequestPayload aRequestPayload = new RequestPayload(); aRequestPayload.action = "ACCESSTOKEN";
Parameter Name Type Description Values Sample Data Allowed character supplyType Text(1) Supply whether it is outward/inward. Refer Code List O Number(2) Sub types of Supply Refer Code List 2 Text(20) Su Supply Description if selected “Others” in subSupplyType docType Text(3) Document Type Refer Code List CHL docNo Text(50) Document No 12 Alphanum, / docDate Text Document Date format 12/09/2017 fromGstin Text(15) GSTIN of the Consignor Alphanum fromTrdName Text(100) LegalName of consignor CO OP BANK fromAddr1 Text(120) Address of consignor - Line 1 Shambhai Fortune fromAddr2 Text(120) Address of consignor - Line 2 Behind KSRTC Bus Stop fromPlace Text(50) Place of consignor Bengaluru Alphabetic fromPincode Number(6) Pincode of consignor 576101 Number Number(2) State of consignor Refer Code List 29 Number(2) State of Supply Refer Code List 4 toGstin Text(15) GSTIN of consignee toTrdname Text(100) Legalname of consignee INDER CHHAJER toAddr1 Text(120) Address of consignee - Line 1 LAYOUT toAddr2 Text(120) Address of consignee- Line 2 toPlace Text(50) Place of consignee Bengaluru Alphabetic toPincode Number(6) Pincode of the consignee 560072 Number toStateCode Number(2) State of Supply Refer Code List 4
cgstRate Decimal(6,3) CGST Rate 9 sgstRate Decimal(6,3) SGST Rate 9 igstRate Decimal(6,3) IGST Rate 18 cessRate Decimal(6,3) CESS Rate 0 status Number(1) Status code 0 - Fail errorCodes Text(200) Refer Error Codes docNo Text(50) Document number of EwayBill ewayBillNo Number(12) Unique E-Way Bill No ewayBillDate Text(22) Date and Time of E-Way Bill Generation hh:mm:ss AM/PM Annexure -A2 : Consolidated E-way bill generation Parameter Name Type Description Values Sample Data Allowed character vehicleNo Text(20) vehicle number fromPlace Text(50) from place of consignor Rajasthan Alphabetic transMode Number(3) Mode of Transportation Refer Code list 2 Number transDocNo Text(50) Transporter Document number 12-86/3 -, / transDocDate Text Transporter Document Date format 12/09/2017 fromState Number(2) State of Consignor Refer Code list 8 List of eway bills ewbNo E-way bill Number generated Number 5
Annexure -A3: Update Vehicle number Parameter Name Type Description Values Sample Data Allowed character ewbNo E-way bill Generated Numbers vehicleNo Text(20) Vehicle number KA12TR1234 Alpha-numeric fromPlace Text(50) Place of Consignor BANGALORE SOUTH Alpha-numeric fromState State of Consignor Refer Code list 29 Numbers reasonCode Reason code for vehicle updation Refer Code list 2 Numbers reasonRem Text(50) Reason for Vehicle Updation Vehicle details updated Alpha-numeric transDocNo Text(50) Transporter Document number 12-86/3 Alphanumeric, -, / Text Transporter Document Date format 12/09/2017 transMode Mode of Transport Refer Code list 1 Numbers Annexure -A4: Cancel E-way bill Parameter Name Type Description Values Sample Data Allowed character ewbNo E-way bill Generated 131000026768 Numbers Number(1) Reason code for cancelling eway bill Refer Code list 2 Numbers cancelRmrk Text(50) Reason for - cancelling eway bill Vehicle details not updated Alpha-numeric Annexure A5- Reject e-way bill Parameter Name Type Description Values Sample Data Allowed character ewbNo E-way bill Generated 131000026768 Numbers Annexure A6- Update Transporter Parameter Name Type Description Values Sample Data Allowed character ewbNo E-way bill Generated 131000026768 Numbers transporterId Text(15) Transporter Id
Annexure A7- Extend Validity Parameter Name Type Description Values Sample Data Allowed character ewbNo E-way bill number 131000026768 Numbers vehicleNo Text(20) Vehicle number KA12TR1234 Alpha-numeric fromPlace Text(50) Current place BANGALORE SOUTH Alpha-numeric Number(2) Current State Refer Code list 29 Numbers Number(5) Distance remaining to reach destination 10 Max Value = 4000 transDocNo Text(50) Transporter Document number 12-86/3 Alphanumeric, -, / transDocDate Text Transporter Document Date format 12/09/2017 transMode Number(1) Mode of Transport Refer Code list 1 Numbers extnRsnCode Number(1) Reason code for extension of eway bill Refer Code list 2 Numbers extnRemarks Text(50) Reason for – Extension of eway bill Vehicle details not updated Alpha-numeric Annexure A8- Regeneration of Consolidated e-way bill Parameter Name Type Description Values Sample Data Allowed character tripSheetNo Consolidated Bill No (TripSheet No) 1310006768 Numbers vehicleNo Text(20) Vehicle number KA12TR1234 Alpha-numeric fromPlace Text(50) Current place BANGALORE SOUTH Alpha-numeric Number(2) Current State Refer Code list 29 Numbers rsnCode Number(2) Reason code for Regeneration of Consolidated Bill Refer Code list 2 Numbers
rsnRem Text(50) Reason for Regeneration of Consolidated Bill Vehicle details updated Alpha-numeric transDocNo Text(50) Transporter Document number 12-86/3 Alphanumeric, -, / transDocDate Text Transporter Document Date format 12/09/2017 transMode Number(1) Mode of Transport Refer Code list 1 Numbers