public EWBSession EwbSession = new EWBSession();
EWBAPI is the public static class which consist all API methods of e-Way Bill
Function call for Get Auth Token
TxnRespWithObj<EWBSession> TxnResp = await EWBAPI.GetAuthTokenAsync(EwbSession);
if (TxnResp.IsSuccess)
{
// TODO: place code here that you want to exicute after successful call of Get Auth Token API ex.you can store AuthToken And its expiry time
}
Function call for Generate e-Way Bill
ReqGenEwbPl ewbGen = new ReqGenEwbPl();
ewbGen.genMode = "MOB";
ewbGen.userGstin = "05AAACG1895Q1Z4";
ewbGen.supplyType = "O";
ewbGen.subSupplyType = "1";
ewbGen.docType = "INV";
.......................
..............................
// NOTE: Pass full valid required data to generate e-Way Bill
TxnRespWithObj<RespGenEwbPl> TxnResp = await EWBAPI.GenEWBAsync(EwbSession, ewbGen);
if (TxnResp.IsSuccess)
rtbResponce.Text = JsonConvert.SerializeObject(TxnResp.RespObj);
else
rtbResponce.Text = TxnResp.TxnOutcome;
Function call for Get e-Way Bill Detail
string EwbNo = "741007330825";
TxnRespWithObj<RespGetEWBDetail> TxnResp = await EWBAPI.GetEWBDetailAsync(EwbSession, EwbNo);
if (TxnResp.IsSuccess)
rtbResponce.Text = JsonConvert.SerializeObject(TxnResp.RespObj);
else
rtbResponce.Text = TxnResp.TxnOutcome;