We are providing API to verify signed Invoice.
1 .Net & Java Demo project includes code, how to verify Signed Invoice in GenIRN API, also the same code is written in seperate button click function.
TxnRespWithObj<RespPlGenIRN> txnRespWithObj = await eInvoiceAPI.GenIRNAsync(eInvSession, rtbResponce.Text, 250);
RespPlGenIRN respPlGenIRN = txnRespWithObj.RespObj;
string ErrorCodes = "";
string ErrorDesc = "";
if (txnRespWithObj.IsSuccess)
{
//Store respPlGenIRN (manditory - AckDate and SignedInvoice) to verify signed invoice
//below code is to show how to verify signed invoice
respPlGenIRN.QrCodeImage = null; // make QrCode Image null, as it contain some character that will give error in Verifying SignedInvoice
TxnRespWithObj<VerifyRespPl> txnRespWithObj1 = await eInvoiceAPI.VerifySignedInvoice(eInvSession, respPlGenIRN);
VerifyRespPl verifyRespPl = new VerifyRespPl();
if (txnRespWithObj.IsSuccess)
{
verifyRespPl.IsVerified = txnRespWithObj1.RespObj.IsVerified;
verifyRespPl.JwtIssuerIRP = txnRespWithObj1.RespObj.JwtIssuerIRP;
verifyRespPl.VerifiedWithCertificateEffectiveFrom = txnRespWithObj1.RespObj.VerifiedWithCertificateEffectiveFrom;
verifyRespPl.CertificateName = txnRespWithObj1.RespObj.CertificateName;
verifyRespPl.CertStartDate = txnRespWithObj1.RespObj.CertStartDate;
verifyRespPl.CertExpiryDate = txnRespWithObj1.RespObj.CertExpiryDate;
}
2. Verify Signed Invoice Code in decrypted Url
RestClient client = new RestClient(eInvoiceSession.GspApiBaseUrl + "/VerifySignedInvoice");
RestRequest request = new RestRequest(Method.POST);
request.AddHeader("Gstin", gstin);
request.AddHeader("aspid", aspid);
request.AddHeader("password", password);
request.AddHeader("Content-Type", "application/json; charset=utf-8");
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(respPlOfGenIRN); // Give input of Responce payload of generate IRN making QRCode Image as null.
try
{
IRestResponse response = await client.ExecuteTaskAsync(request);
verifyRespPl = JsonConvert.DeserializeObject<VerifyRespPl>(response.Content);
VerifyRespPl verifyRespPl = null;
txnRespWithObj = new TxnRespWithObj<VerifyRespPl>();
txnRespWithObj.RespObj = verifyRespPl;
}
catch (Exception ex)
{
strOutcome = ex.Message;
}
public class VerifyRespPl
{
public bool IsVerified { get; set; }
public string JwtIssuerIRP { get; set; }
public string VerifiedWithCertificateEffectiveFrom { get; set; }
public string CertificateName { get; set; }
public string CertStartDate { get; set; }
public string CertExpiryDate { get; set; }
}