Shared session
Use the same access token for e-Invoice and E-Way Bill APIs.
Dual-IRP routing
Select NIC1 or NIC2 with
x-source, or send requests to the other server with x-proxy.Complete e-Invoice lifecycle
Generate IRNs, retrieve or cancel e-Invoices, and generate or retrieve E-Way Bills by IRN.
Signed invoice, QR code & PDF
Receive the signed invoice and QR code. Use them to generate an e-Invoice PDF.
Prerequisites: To use GST e-Invoice API, you need: (1) API credentials created on the e-Invoice portal, (2) credentials mapped to your GSP, and (3) a Sandbox API key and API secret. Send the API key in the
x-api-key header on every request.How it works
1
Create API credentials on e-Invoice portal
Register on the e-Invoice portal and create API credentials. Map these credentials to your GSP (Goods and Services Tax Suvidha Provider). See Create API credentials for detailed instructions.
2
Authenticate with Sandbox
Call the Sandbox authentication endpoint to obtain a Sandbox access token (JWT). Use this token to authenticate with the IRP and to generate e-Invoice PDFs.
3
Authenticate with e-Invoice IRP
Call the e-Invoice authentication endpoint with your e-Invoice credentials to create a session. Send the returned IRP access token in the
authorization header of later e-Invoice and E-Way Bill operations. See the Generate e-Invoice session recipe for implementation details.4
Generate e-Invoice
Post your invoice object to the Generate e-Invoice endpoint. On success, receive the IRN, signed invoice JSON, and signed QR code. Optionally generate an E-Way Bill in the same call. See the Generate e-Invoice recipe for a complete walkthrough.
5
Generate e-Invoice PDF
Call the Generate PDF endpoint with the IRN, signed invoice, and signed QR code. Send your Sandbox access token for this request.
6
Fetch e-Invoice
Retrieve an e-Invoice by IRN using Get e-Invoice or by document type, number, and date using Get e-Invoice by document data.
7
Cancel e-Invoice (if needed)
Cancel an e-Invoice by IRN within the cancellation window when required.
8
Generate E-Way Bill for transportation
Generate or fetch E-Way Bills linked to the IRN for logistics and transportation compliance.
API endpoints
Authentication
e-Invoice operations
E-Way Bill (from e-Invoice)
Master data and error codes
e-Invoice master data
Find state, country, port, currency, and unit quantity codes for e-Invoice requests.
e-Invoice error codes
Find NIC authentication, IRN, and E-Way Bill errors returned in
ErrorDetails. E-Way Bill entries cover e-Invoice and IRN operations.Common use cases
Use GST e-Invoice API when you need to:- Generate GST e-invoices (IRN) and store signed invoice + QR for compliance and audit
- Provide “Download invoice PDF” functionality to customers and finance teams
- Cancel wrongly issued e-invoices by IRN within the cancellation window
- Fetch e-invoices by IRN or by document reference for reconciliation and support
- Generate and retrieve E-Way Bills linked to IRN for logistics and transportation
- Validate GSTIN details via IRP lookup before invoicing
Frequently Asked Questions
What is GST e-Invoice?
What is GST e-Invoice?
GST e-Invoice is a GST-compliant invoice registered with India’s Invoice Registration Portal (IRP). Each e-Invoice receives a unique Invoice Reference Number (IRN) and is digitally signed by the IRP. The signed invoice and QR code serve as proof of registration for compliance and audit purposes. See Create API credentials to get started.
How does GST e-Invoice API work end-to-end?
How does GST e-Invoice API work end-to-end?
The workflow is: create e-Invoice API credentials and map them to your GSP, authenticate with Sandbox for a JWT, authenticate with the IRP for a session token, submit invoice data to generate the IRN with signed invoice and QR code, then optionally generate a PDF and manage fetch, cancel, or E-Way Bill actions. See the Generate e-Invoice recipe for a complete example.
How do I select NIC1 or NIC2?
How do I select NIC1 or NIC2?
Set
x-source to primary for NIC1 or secondary for NIC2. It defaults to primary on each request. See Dual-IRP routing for session requirements and x-proxy examples.What credentials are required to call e-Invoice Authentication?
What credentials are required to call e-Invoice Authentication?
e-Invoice Authentication requires credentials created on the e-Invoice portal: your GSTIN, username, and password. These credentials must be mapped to your GSP (Goods and Services Tax Suvidha Provider). The Create API credentials guide provides step-by-step instructions for setting up these credentials.
Why does e-Invoice PDF generation use Sandbox JWT instead of the e-Invoice token?
Why does e-Invoice PDF generation use Sandbox JWT instead of the e-Invoice token?
e-Invoice PDF generation is a Sandbox service, not an IRP service. The IRP provides the signed invoice JSON and QR code data, but does not offer PDF generation. Sandbox renders the PDF from this data, so the Generate e-Invoice PDF endpoint requires a Sandbox JWT for authentication rather than the IRP session token.
Can I generate an E-Way Bill from an e-Invoice IRN?
Can I generate an E-Way Bill from an e-Invoice IRN?
Yes, GST e-Invoice API supports generating E-Way Bills linked to an existing IRN. Use the Generate E-Way Bill endpoint with the IRN to create an E-Way Bill for transportation. You can also retrieve E-Way Bill details by IRN.