e-Invoice API | Direct IRP integration

e-Invoice API - Generate IRNs at scale. In under 200 milliseconds.

The e-Invoice API for billing systems, ERPs, and B2B marketplaces. Create, cancel, amend, and manage IRNs through a documented API workflow.

1import WhiteBooks from '@whitebooks/node'
2
3const client = new WhiteBooks({
4 apiKey: process.env.WB_API_KEY,
5 sandbox: false,
6});
7
8// Generate an e-invoice (IRN)
9const irn = await client.einvoice.generate({
10 gstin: "29AAGCW7302R1ZF",
11 invoiceType: "B2B",
12 invoiceNumber: "INV-001",
13 invoiceDate: "2026-07-29",
14});
15
16console.log("IRN:", irn.irn)
200 OK·142ms

Three reasons e-invoicing integrations fail in production.

01

The 30-day window is unforgiving

For AATO above ₹10 crore, invoices not reported to the IRP within 30 days are invalid for ITC. If your integration ages out invoices silently, your customers lose money. WhiteBooks surfaces window-at-risk invoices via webhook before they expire.

02

The IRP has unplanned outages

Around month-end, IRP latency spikes and intermittent failures are common. Naive integrations fail; resilient ones queue and retry. WhiteBooks queues and retries on your behalf, surfacing only the ones requiring human decision.

03

Schema changes break integrations

The IRP schema has changed multiple times since 2020. Each change breaks integrations that hardcoded the old schema. WhiteBooks abstracts the schema — you call our API, we adapt to IRP changes.

The endpoints. Documented like an API should be.

GET /einvoice/authenticate

Authenticate with the IRP and obtain a session token. Required before any invoice operation. Returns auth token and GSTIN details.

POST /einvoice/type/GENERATE

Generate the IRN, signed QR code, and acknowledgment number for a document. Full B2B invoice JSON in, signed e-invoice out.

POST /einvoice/type/CANCEL

Cancel an IRN within 24 hours of generation, with a reason code and remark. Returns the updated IRP state.

GET /einvoice/type/GETIRN

Fetch full e-invoice details for any IRN generated in the last 72 hours — signed payload, status, and QR code.

GET /einvoice/type/GETIRNBYDOCDETAILS

Look up an IRN by document type, number, and date when you don't have the IRN on hand. Same 72-hour window.

GET /einvoice/type/GETREJECTEDIRNS

Retrieve the list of IRNs rejected by the IRP for the authenticated session. Returns rejection reason codes for each failed document.

POST /einvoice/type/GENERATE_EWAYBILL

Generate an e-way bill directly from an existing IRN — transporter, vehicle, and distance details in one call.

GET /einvoice/type/GETEWAYBILLIRN

Retrieve the e-way bill number linked to a given IRN. Returns full EWB details, validity period, and transport mode.

GET /einvoice/type/GSTNDETAILS

Fetch full GSTN details for a GSTIN via the IRP — legal name, trade name, address, constitution type, and registration status.

GET /einvoice/type/SYNC_GSTIN_FROMCP

Sync GSTIN details from the Compliance Portal into the IRP session cache. Ensures your buyer/seller data is fresh before invoice generation.

GET /einvoice/qrcode

Generate the B2C dynamic QR code — UPI ID, bank details, and tax breakup — for consumer invoices.

40+ ERP Integrations

SDKs, code examples, and integration guides.

Official SDKs in Node.js, Python, PHP, Java, Go. Working integrations for Stripe-style billing platforms, Razorpay merchant flows, custom ERPs, and bulk dispatch workflows. HMAC-signed webhooks for every state transition.

Real-time Sync

Native connectors for instant data flow

Always Up-to-date

Maintained against every ERP upgrade

Zero Manual Work

No CSV exports. No email uploads.

Enterprise Secure

Bank-grade security & data protection

40+
ERP Integrations
1000+
Customers using integrations
Real-time
Data Push
99.99%
Uptime SLA
  • Node.js
  • Python
  • PHP
  • Java
  • Go
  • Postman
  • OpenAPI 3.1

Smart features that fit into your code.

WhiteBooks runs a shared AI engine across every product. Trained on Indian compliance data, tuned for finance teams, and embedded in the workflows you already use.

01

HSN auto-suggestion endpoint

GET /v1/hsn/suggest?description=... returns the most likely HSN code and current rate for a product description. Useful for marketplaces accepting seller-uploaded products.

02

Anomaly flagging in webhook payloads

Webhook events include a risk_flags array — high-value invoice to a new buyer, GSTIN with falling compliance score, unusual HSN pattern. Surface these in your UI for human review.

03

Compliance copilot for end users

Embed WhiteBooks' compliance copilot in your product via the AI Q&A endpoint. Your users ask questions in natural language; the copilot answers from their live data.

04

Place-of-supply auto-resolution

WhiteBooks reads the buyer GSTIN and shipping address, resolves the place of supply, and applies IGST vs CGST/SGST automatically. Handles bill-to/ship-to splits, third-party movements, and SEZ transactions.

Frequently asked Questions.

How fast is IRN generation?+
Sub-200ms p50 response time on WhiteBooks' own side of the call — the direct GSP pipe, not a resold one. The remaining time is upstream IRP processing, which WhiteBooks doesn't control but does queue and retry through. Check the status page for current platform availability.
What happens if the IRP is down?+
WhiteBooks queues your IRN requests and retries with exponential backoff. You receive a 'pending' status immediately; the IRN comes back via webhook once the IRP responds. Your code doesn't need to handle IRP outages.
Can I cancel an IRN after 24 hours?+
No — GSTN rules don't permit IRN cancellation after 24 hours. After 24 hours, you must issue a credit note linked to the original IRN. The /credit-note endpoint handles this.
Does the API enforce the 30-day reporting window?+
Yes. For businesses with AATO above ₹10 crore, the API will reject IRN requests for invoices more than 30 days old, per GSTN rules. Webhooks alert you to invoices approaching the deadline.
How does pricing work for bulk operations?+
Each IRN in a bulk batch counts as one call against your monthly quota. Bulk doesn't have separate pricing — it's the same per-call rate.
Do you provide a Postman collection?+
Yes. One-click import from the API docs. Pre-configured for sandbox; swap the API key to point at production.

April 2026 is closer than your customers think.

The ₹5 crore AATO mandate goes live April 1, 2026. Billing systems and ERPs serving Indian SMBs need e-invoicing capability — and most can't build it from scratch in time. WhiteBooks ships the capability in a sprint.

See pricing · Full API reference