TaxPro GSP - eInvoiceAPI
User Guide
 
 
×
Menu
Index
  • Support for Multiple IRP

Support for Multiple IRP

 
TaxPro GSP supports E-Invoice Interoperable services.  ASPs may give control of the same to their end users through their UI.
 
 At e-Invoice1 portal, you can access services of einvoice2 and vice versa. That is, IRNs generated at e-Invoice2 Portal will be available at e-Invoice1 for cancellation and ewaybill generation. Similarly, IRNs generated at e-Invoice1 will be available at eInvoice2.
 
To access the services of einvoice2, namely ‘Get IRN’, ‘Cancel IRN’ and ‘Eway bill by IRN’ from einvoice1, the URL and end points are same as of einvoice1, an additional
header parameter ‘irp’ with value ‘2’ needs to be passed, which indicates that service requested is from e-Invoice2. Similarly ‘irp’ should be ‘1’ to access these
services of e-Invoice1 from e-Invoice2.
 
In the absence of ‘irp’ header parameter, APIs will work for the data available locally or the URL accessed.
 
APIs available for criss-cross operations between these sites are.
 Get IRN Details
 Cancel IRN
 Get IRN Details by Doc. Details
 Generate e-Waybill by IRN
 Get e-Waybill details by IRN
 
How to Use Multiple IRP by ASP For Decrypted APIs?
1. API user / developer has to pass 'irpurl' parameter either in Header or Query as value 1 (for e-Invoice1) or 2 (for e-Invoice2).
2. API user / developer has to pass 'irp' parameter either in Header or Query as value NIC1 (for NIC IRP-1) or NIC2 (for NIC IRP-2).
 
IRN generated on particular IRP would be recognized  by any IRP. (i.e.IRN generated by IRP 1 would be recognized by IRP 2 and vice versa.)
 
How to know perticular IRN Generated on which portal
If 1st Caracter Of AckNo is '1' => it indicates IRN generated on e-Invoice1 Portal
If 1st Caracter Of AckNo is '2' => it indicates IRN generated on e-Invoice2 Portal
 
AckNo: 1XXXXXXXXXXXXXXX
Generated at e-Invoice1
AckNo: 2XXXXXXXXXXXXXXX
Generated at e-Invoice2
 
.Net Framework library and Java library Users have to do following changes in UI
 
1. Provide the access to select irp url and irp value through UI as shown below
 
 
 
2. On SelectedIndexChanged of IRPUrl, Assign selected value of irpurl to eInvSession.eInvApiLoginDetails.IRPUrl
 
      private void cmbIRPUrl_SelectedIndexChanged(object sender, EventArgs e)
        {
            eInvSession.eInvApiLoginDetails.IRPUrl = (cmbIRPUrl.SelectedItem as dynamic).Value;
        }
 
3. On SelectedIndexChanged of IRP, Assign selected value of irp to eInvSession.SelIRP
 
private void cmbIRP_SelectedIndexChanged(object sender, EventArgs e)
        {
            eInvSession.SelIRP = (cmbIRP.SelectedItem as dynamic).Value;
        }
 
Below changes has been done to library to support Interoperability for multiple taxpayer.
 
i. One more paramater SelIrp with default value 1 added to eInvoiceSession constructior.  Library Users needs to maintain 2 seperate eInvApiLoginDetails.  NIC UserName and Password for both IRP is same but Library will store different AuthToken and SEK in 2 seperate eInvApiLoginDetails.  If you are using default values in eInvoiceSession (default true for second paramater LoadAPILoginDetailsFromConfigFile), library will automatically create 2 eInvApiLoginDetails entries in E_InvoiceApiLoginDetails.json config file.  Also library will take care of updating respective entries on internally refreshing AuthToken.
 
For Example: public TPSession(int TPID, int SelIrp) : base(true, false, SelIrp)
 
 
ii.  RefreshAuthTokenCompleted event will get AuthTokenEventArg where event handler should read SelIrp value from AuthTokenEventArg and save or update respective IRP AuthToken and SEK;
 
For Example:
private void SaveNewAuthToken(object sender, AuthTokenEventArg e)
              {
                    //Write your code to save New AuthToken, SEK to DB for TaxPayerID and SelIRP
                    UpdateDatabase(TaxPayerID, e.SelIrp);
}
 
iii.  New event SelIrpChanged added in case user wants to change SelectedIrp by assigning directly to SelIRP in already created eInvoiceSession object.  This event may be used to Load APILoginDetails of changed IRP by reading SelIrp from SelIrpChangedEventArg.  This would be useful if you are using Singleton eInvoiceSession.
 
For Example:
private void SelectedIPRChanged(object? sender, SelIrpChangedEventArg e)
             {
                //Load LoginDetails for e.SelIrp  in eInvSession.
                 LoadEInvLoginDetail(TaxPayerID, e.SelIrp);
             }