How we enabled India E-Invoicing Portal Integration on ERPNext


Tacten.co #Howto #ERPNext #E-Invoice #E-Invoice

 · 5 min read

For a self-hosted multi-company, multi-city B2B Manufacturing Client

blog

What is the E-Invoicing Requirement?

Under the new e-invoicing system requirement laid out by the Government of India, businesses with turnover higher than ₹50Cr are required to get all business to business (B2B) invoices electronically authenticated with GSTN by generating a unique Invoice Reference Number (IRN).

E-Invoicing has been introduced to standardise all B2B invoicing process. All ERPs and software have to accommodate the invoice format defined by GSTN. Another advantage that E-Invoicing brings about is that it will provide a level of automation in filing monthly GSTR reports.

To help automate this process of authenticating with the GSTN and generting the IRN number for each invoice right from the billing module of your ERP software — there are certain Government approved GST portal API integration gateway providers called GSPs(GST Suvidha Providers), whose REST API services can be integrated with the invoicing module to automate the process of generating E-Invoicing right from your ERP. This avoids the hassles of separate manual login to the e-invoice portal to generate the E-Invoice for your bills.


Our customer

Our customer is a multi-company (5 different GST registered legal entities), having operations in 5 different metro cities across India. This requirement was bought to our notice by the client with just a week remaining to the target date. Thankfully we had done our homework well and had also reminded the client of this requirement in several occasions in the past too.

How we went about enabling the E-Invoicing feature of ERPNext for the client.

Before that some background.


About ERPNext E-Invoicing Feature

ERPNext had developed the E-Invoicing capability in the Sales Invoice module of the software a while ago and this feature was made available on both its V12 stable version and on V13 too. ERPNext has currently integrated the GSP (GST Suvidha Provider) API gateway of a provider called Adaequare. There are quite a few other authorised GSPs as well.

The details of setup of standard E-Invoicing can be found here: https://docs.erpnext.com/docs/user/manual/en/regional/india/setup-e-invoicing

So the process works like this — the software vendor needs to register themselves with the GSP as an ASP (API Service Provider) and purchase a package from them based on the total number of IRN generation API and E-Way bill API calls needed in a year. Roughly a 20K API calls a year cost about ~INR 10K

So in our particular scenario — we Tacten, had to sign-up as an ASP vendor with the GSP called Adaequare and had to purchase an API usage package from them and use our ASP credentials in our customer’s ERPNext instance to enable the API integration from the software.

However if your customer’s ERPNext is directly hosted by ERPNext.com or on Frappecloud.com — the Adaequare api credentials for you to use is by default provisioned by Frappe itself. Since Frappe Technologies is also an ASP vendor.


Setting up the ASP credentials in the self-hosted ERPNext setup of our client

When the ASP (the software vendor) signup as an ASP with Adaequare, they will provide

  1. full API documentations,
  2. Postman collections to test the API calls
  3. Sandbox environment to test the credentials and also test GSTIN numbers and logins.

This will help the ASP to test the feature in a sandbox environment before enabling the live credentials.

Thankfully in ERPNext all the API integration logic is already built and the feature is available as button click in the sales invoice — and as an ASP all we needed to do was update our GSP API credentials in the site config file like this:


blog


Once you have done this step — all you need to do is follow the steps provided in the official documentation of page by ERPNext to enable the feature in your ERPNext site.


Multi-Company GST setup in the E Invoice Settings Page

Finally for a multi company setup — we need to register each companies GST number and E-invoicing API credential that is created for each GST company (as described in the official ERPNext documentation ) in the E Invoicing Settings page of ERPNext as below:

blog


Some challenges we faced

Since ours client setup was a multi-company, multi-city business setup in ERPNext — they do a lot of intra company sales with each other and we faced a particular challenge with Shipping address GSTIN number validation in ERPNext in such scenario.


The billing scenario: (Inter-company sales & Shipping address GSTIN validation issue)

When the company in Bangalore (Karnataka State) places an order to the company in Andra-Pradesh state and the final finished product delivery is to an end-customer in Telangana state, the standard logic in ERPNext wouldn’t allow if the end-customer delivery address is a non-GST customer.

The actual sales is only between the two companies (Bangalore and Andra-Pradesh), but the shipping delivery address to a consumer in Telangana state.

So the standard validation in ERPNext wouldn’t allow to create E-Invoice if the GSTIN is empty for the shipping address in the sales invoice.

For this we had to fix the core logic in ERPNext to avoid the shipping address GSTIN validation and had raise a PR for the same.

fix(regional): remove shipping address GSTIN validation for e-invoice by bhavesh95863 · Pull…

We have one case in which the billing address has GSTIN but the shipping address has no GSTIN. I checked Adaequare API… github.com


HSN code mandatory validation for 6 or more digits:

The GSP gateway API for e-invoice wont accept HSN codes that are less than 6 digits. That is mandated by the e-invoice portal for generating successful IRN. This validation was not present by default in ERPNext in side while creating and Item. We had to put this validation in place so that users wont be able to save sales orders or even create items without the correct HSN code requirement.


Important Glossary of Terms and Resources

  1. GSP — GST Suvidha Provider ( adaequare.com)
  2. E-Invoicing Portal of Govt. of India
  3. Official ERPNext Documentation for E-Invoicing
  4. The same GSP API integration works for auto generation E-Way bill too. Details of ERPNext setup for E-Way bill is available here: https://docs.erpnext.com/docs/user/manual/en/regional/india/auto-generate-e-way-bill-JSON


ERPNext gives you the option to configure the print format for E-Invoice with IRN as required by the Tax department: blog


About Us — Tacten LLP — a Bangalore-India based ERPNext partner company that offers full line of services around ERPNext and Frappe. We are a team of software developers and domain experts with an obsessive focus on helping our customers exceptionally succeed with ERPNext and Frappe. Our primary area of expertise are in the Manufacturing and Healthcare domain. We have the experience of implementing ERPNext to several domestic and international clients under our belt.


A
Atul-Kuruvilla

Github: pythonpen

No comments yet.

Add a comment
Ctrl+Enter to add comment