Integration Guides

GST E-Invoicing API: How to Integrate Your Billing Software

Who must generate e-invoices, how IRN generation works, access through a GSP or directly, the API flow, validations, cancellation rules and common integration errors.

Purushottam Kumar Suman
Purushottam Kumar Suman
Founder & CEO, Drema AI
8 min read
Code on a screen

E-invoicing under GST does not mean generating invoices on a government site. Your billing software creates the invoice as before, then reports it to an Invoice Registration Portal, which validates it and returns a unique Invoice Reference Number and a signed QR code. Without those, the invoice is not valid for a business that is covered.

01

Who is covered

E-invoicing applies to GST-registered businesses whose aggregate annual turnover exceeded ₹5 crore in any financial year from 2017-18 onwards. Once covered, a business stays covered. It applies to business-to-business supplies, exports and supplies to SEZs, including credit and debit notes. Certain classes are exempt, including banks and financial institutions, insurers, goods transport agencies, passenger transport services and SEZ units.

₹5 crore
Aggregate turnover threshold
30 days
Reporting limit for turnover of ₹10 crore and above
24 hours
Window to cancel an IRN on the portal
02

How it works

The exchange is a single API call per document, wrapped in authentication.

1. Create the invoiceIn your ERP or billing software
2. Build the JSONIn the notified e-invoice schema, with mandatory fields
3. Send to the IRPThrough an authenticated, encrypted API call
4. IRP validatesSchema, GSTINs, duplicate check and tax calculations
5. Receive the responseIRN, acknowledgement number and date, digitally signed invoice and signed QR code
6. PrintThe QR code and IRN on the invoice given to the buyer
7. DownstreamData flows to GSTR-1, and can generate the e-way bill
03

Ways to get API access

There are several IRPs, and several ways to reach them.

Through a GST Suvidha ProviderThe common route. The GSP provides API credentials, a sandbox and support; you pay per invoice or a subscription
Through your ERP vendorMany ERPs embed a GSP connection
Direct API accessAvailable to larger taxpayers who meet the turnover and infrastructure conditions, including whitelisted static IP addresses
Offline tools and portalBulk upload utilities for low volumes, with no integration
04

Integration details

A few technical points cause most of the effort.

Clean the customer and item masters before go-live. The API will reject what the print format used to hide.

AuthenticationClient ID and secret plus the taxpayer's API username and password yield a time-limited token and session key
EncryptionRequest payloads are encrypted with the session key; responses are decrypted the same way
IRN uniquenessThe IRN is a hash of supplier GSTIN, financial year, document type and document number, so document numbers must never repeat
Master dataValid GSTINs, PIN codes, HSN codes and units of measure; most rejections come from here
RoundingTax and total values must match the portal's tolerance
IdempotencyOn timeout, query by document details before resending to avoid duplicate errors
05

Cancellation and amendment

An e-invoice can be cancelled on the IRP only within 24 hours, and only in full. It cannot be edited on the IRP. After 24 hours, corrections are made through credit or debit notes, which are themselves reported, or through amendments in GSTR-1. Taxpayers with aggregate turnover of ₹10 crore and above cannot report documents older than 30 days, so late reporting is blocked by the system.

06

What to build around the API

The call itself is small. The value is in the surrounding workflow.

Pre-validation before submitQueue with retriesError dashboard with reasonsStore signed JSON and QRInvoice print with QRBulk generationCancellation within 24 hoursE-way bill generationGSTR-1 reconciliationAlerts before the 30-day limit
Sources · last reviewed October 1, 2026

This article explains what to build, not legal advice. Rules change; confirm against the current official text before relying on it.

Purushottam Kumar Suman
Written by
Purushottam Kumar Suman
Founder & CEO, Drema AI

Founder and CEO of Drema AI. Builds AI systems, SaaS platforms and industry software — and writes about what actually survives production.

CTA Background

Got a problem like this one?

Bring it to a call with a founder.You will get a straight answer, including when the answer is no.

View Our Work
AI-First Engineering
Secure & Scalable
Built to Deliver Impact