All e-way bill and e-invoice API calls

E-invoice generate API (IRN)

POST /v1/einvoice

Short answer

Send one e-invoice JSON in the government's INV-01 format. You get the IRN, acknowledgement number and date, the signed QR code and the signed invoice. Add the transport block to the same payload and the e-way bill is generated in the same call, billed once.

Cost: 3 credits per successful call. A rejection or an upstream failure is never charged.

Every call accepts "test_mode": true and returns a sample in the live shape, free. Set up your API credentials before the first real call.

What comes back

irn, ack_no and ack_date identify the registered invoice. qr_code_image and signed_invoice are the signed QR and the signed invoice exactly as the network issued them. qr_code_image is the QR payload to print, so you need a QR library on your side to draw it.

An e-way bill in the same call

Include the transport block (EwbDtls: vehicle number, transport mode, distance) in the payload and the response also carries the e-way bill number, date and validity. If the IRN is issued but the e-way bill is refused, the response says so instead of hiding it.

Duplicate invoice numbers

If you send an invoice number that already has an IRN, the real IRN is returned with already_existed set to true, billed like a fresh success. A timed-out call is therefore safe to repeat with the same invoice number.

A cheap check first

POST /v1/einvoice/validate is free and checks the payload for the mistakes behind most rejections. Obvious tax-arithmetic mismatches are also stopped here before they reach the network, which never costs you anything.

Request fields

FieldTypeRequiredMeaning
gstinstringYesThe GSTIN you issue the invoice as.
einv_usernamestringYesThe e-invoice API username for that GSTIN. Never stored.
passwordstringYesThe matching API password. Never stored.
payloadobjectYesOne e-invoice (INV-01) JSON payload.
txn_typestringNoINV, CDN or DBN. Defaults to INV.
test_modebooleanNotrue returns a sample in the live shape: free, nothing is filed.

Send your API key in the x-api-key header. Government API credentials are used for the one call and never stored.

Example

The request below runs in test mode, so it is free and files nothing. Remove test_mode for a real call.

curl -X POST "https://www.gstinapi.in/v1/einvoice" \
  -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{ "gstin": "24AAAAA0000A1Z5", "einv_username": "YOUR_EINV_API_USER", "password": "YOUR_EINV_API_PASSWORD", "payload": { "Version": "1.1", "DocDtls": { "Typ": "INV", "No": "INV-1001" } }, "test_mode": true }'

Response

{
  "success": true,
  "irn": "35a1b2c3...",
  "ack_no": "112010012345678",
  "ack_date": "23/10/2026 10:00:00",
  "qr_code_image": "eyJhbGci...signed-qr...",
  "signed_invoice": "eyJhbGci...signed-invoice...",
  "ewaybill_no": null,
  "already_existed": false,
  "billed_to": "paid",
  "credits_remaining": 197
}

Errors you can expect

CodeMessageWhat to do
2150Duplicate IRNHandled for you: the existing IRN is returned with already_existed: true.
2234SGST and CGST amount does not match taxable value and tax rateA tax amount does not match the taxable value at its rate. Fix the arithmetic; it is stopped before reaching the network and is free.
3026E-Invoice options are not enabled for this GSTINThe GSTIN has not been enabled for e-invoicing on the e-invoice portal.

All e-way bill API error codes

Questions

Which credentials do I send?
The e-invoice API user for the GSTIN, created on the e-invoice portal. It is separate from the e-way bill API user, even for the same GSTIN.
Can I test without a registration?
Yes. test_mode returns a sample in the live shape with a TEST- prefixed IRN, free.

Not affiliated with the Government of India. Rules are the government network's own and can change; if a page here looks out of date, tell us.