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.
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.
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.
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.
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.
| Field | Type | Required | Meaning |
|---|---|---|---|
| gstin | string | Yes | The GSTIN you issue the invoice as. |
| einv_username | string | Yes | The e-invoice API username for that GSTIN. Never stored. |
| password | string | Yes | The matching API password. Never stored. |
| payload | object | Yes | One e-invoice (INV-01) JSON payload. |
| txn_type | string | No | INV, CDN or DBN. Defaults to INV. |
| test_mode | boolean | No | true 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.
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
}| Code | Message | What to do |
|---|---|---|
| 2150 | Duplicate IRN | Handled for you: the existing IRN is returned with already_existed: true. |
| 2234 | SGST and CGST amount does not match taxable value and tax rate | A tax amount does not match the taxable value at its rate. Fix the arithmetic; it is stopped before reaching the network and is free. |
| 3026 | E-Invoice options are not enabled for this GSTIN | The GSTIN has not been enabled for e-invoicing on the e-invoice portal. |
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.