public EWBSession EwbSession = new EWBSession();
public EwbApiCall apiCall = new EwbApiCall();
Function call for Get Auth Token
public void GetAuthToken(){
TxnRespWithObj<EWBSession> TxnResp = apiCall.GetAuthToken(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
}
txtResponce.append(TxnResp.TxnOutcome + "\n\n");
}
Function call for Generate e-Way Bill
EWBJson.ReqGenEwbPl ewbGen = new EWBJson.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<String> RespObj = apiCall.GenerateEwb(EwbSession, ewbGen);
if (RespObj.IsSuccess == true)
txtResponce.setText(gson.toJson(RespObj.RespObj));
else
txtResponce.setText(RespObj.TxnOutcome);
Function call for Get e-Way Bill Detail
String EwbNo = "321000867513";
TxnRespWithObj<String> txnResp = apiCall.GetEWBDetail(EwbSession, EwbNo);
if (txnResp.IsSuccess)
txtResponce.setText(gson.toJson(txnResp.RespObj);
else
txtResponce.setText(txnResp.TxnOutcome);