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

Support for Multiple IRP

 
TaxPro GSP supports NIC IRP-1 and NIC IPR-2 through same api end points and has given control of IRP selection to ASPs.  ASPs may give control of the same to their end users through their UI.
 
How to Use Multiple IRP by ASP?
 
API user / developer has to pass 'IRP' parameter either in Header or Query as value 1 (for NIC IRP-1) or 2 (for NIC IRP-2). IRN generated on particular IRP would be recognized only by that IRP. (i.e.Invoice IRN generated by IRP 1 would not be recognized by IRP 2 and vice versa.) Thus, on the backend, ASP needs to store IRP value along with Invoice (or say IRN) and always pass this IRP value to get IRN details or to cancel IRN or GenEWB by IRN or any further IRN operations. (Note: This feature is available in production only and Sandbox will ignore IRP parameter.)
 
 
1. Provide control to your users through UI
 
i.     ASPs may modify their software UI to include IRP Selection, drop-down as below or else, so that user can manually switch IRP in case there is no response or timeouts form one IRP.
 
2. Store IRP Value (1 or 2), depending on the IRP used to generate IRN, for every Invoice.  This field will supply value for IRP for further requests related to that IRN or Invoice database table row.
 
3. Both NIC IRP setup being completely independent, AuthToken for NIC IRP-1 and NIC IRP-2 are different, respective AuthToken needs to be stored and used by ASP.  In other words, pass AuthToken of IRP-1 if you are passing IRP=1  or not passing IRP parameter (default) and pass AuthToken of IRP-2 if you are passing IRP=2.
 
4. Library Version 4.0 or above has support for Multiple IRP.
 
Below changes has been done to library to support multiple IRP.
 
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);
             }
 
5. I have already integrated TaxPro GSP eInvoice Library, what are the minimal changes I need to do to suport multiple IRP.
 
i. If you are using config files to store eInvApiLoginDetails, Do Nothing to store multiple Irp eInvApiLoginDetails. Just use SelIrp in eInvoiceSession in constructor or change SelIrp property of already created eInvoice Session.
 
ii. If you are supporting multiple GSTIN (muliple taxpayers), i.e. loading and storeing eInvApiLoginDetails in your code,  take care of SelIrp while loding eInvApiLoginDetails and use SelIrp of AuthTokenEventArg in RefreshAuthTokenCompleted event handler.
 
6.     API response error codes are already prefixing ‘NICxxx” (viz. ‘NIC504’) to IRP timeout errors and GSP time-out error is ‘GSP032’, use these error-codes to put checks on unavailability of IRP setup.