Type
|
Url
|
Headers
|
SandBox
|
https://gstsandbox.charteredinfo.com/eiewb/dec/v1.03/ewaybill
|
1. aspid
2. password
3. Gstin
4. user_name
5. AuthToken
6. irpurl
7. irp
|
Production
|
https://einvapi.charteredinfo.com/eiewb/dec/v1.03/ewaybill
|
1. aspid
2. password
3. Gstin
4. user_name
5. AuthToken
6. irpurl
7. irp
|
string strJson = File.ReadAllText(@"C:\Users\Pallavi\Desktop\e-Invoice\SampleJsonGenEwbByIRN.txt");
RestClient client = new RestClient("https://gstsandbox.charteredinfo.com/eiewb/dec/v1.03/ewaybill");
RestRequest request = new RestRequest(Method.POST);
request.AddHeader("Gstin", "29AACCC1596Q000");
request.AddHeader("user_name", "TaxProEnvSB");
request.AddHeader("AuthToken", "**********");
request.AddHeader("aspid", "********");
request.AddHeader("password", "********");
// Need to pass Either NIC1 OR NIC2 in Header
request.AddHeader("irp", "NIC1");//used by nic (value ‘NIC1’ indicates that service requested is from e-Invoice1).
request.AddHeader("irp", "NIC2");//used by nic (value ‘NIC2’ indicates that service requested is from e-Invoice2.)
// Need to pass Either "1" OR "2" in Header
request.AddHeader("irpurl", "1");//Used By gsp
request.AddHeader("irpurl", "2");//Used By gsp
request.AddHeader("Content-Type", "application/json; charset=utf-8");
request.RequestFormat = DataFormat.Json;
//ReqPlGenIRN reqPlGenIRN = new ReqPlGenIRN();
//reqPlGenIRN = JsonConvert.DeserializeObject<ReqPlGenIRN>(strJson);
//request.AddBody(reqPlGenIRN);
request.AddParameter("application/json", strJson, ParameterType.RequestBody);
IRestResponse response = await client.ExecuteTaskAsync(request);