Signed QR Code Retrieval API

Retrieve the NIC-signed QR code for any previously-generated IRN. Returns the base64 image and the raw signed data block for embedding in PDFs.

Get sandbox keys → View OpenAPI docs Talk to sales

What is the Signed QR Code Retrieval API?

The Signed QR Code Retrieval API returns the cryptographically-signed QR code NIC generates alongside every IRN. The QR contains the key invoice fields (supplier GSTIN, recipient GSTIN, invoice number, date, value, item count, IRN) signed with NIC's RSA private key — making it tamper-evident.

The signed QR is mandatory on the invoice PDF/print and is what tax officers scan to verify e-Invoice authenticity at checkpoints. The API returns both the base64-encoded QR image (300×300px PNG) and the raw signed data block (JWS format) for embedding in custom invoice templates.

Quick spec

Code examples

curl Node.jsPythonJava
curl -X GET 'https://apisandbox.whitebooks.in/einvoice/api/v1/irn/a4d2cb7fe33ab26.../qr' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json'
Node.js
const res = await fetch('https://apisandbox.whitebooks.in/einvoice/api/v1/irn/a4d2cb7fe33ab26.../qr', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer ' + accessToken,
    'Content-Type': 'application/json',
  },
});
const data = await res.json();
Python
import requests

resp = requests.get(
    'https://apisandbox.whitebooks.in/einvoice/api/v1/irn/a4d2cb7fe33ab26.../qr',
    headers={'Authorization': f'Bearer {access_token}'},
)
data = resp.json()
Java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://apisandbox.whitebooks.in/einvoice/api/v1/irn/a4d2cb7fe33ab26.../qr"))
    .header("Authorization", "Bearer " + accessToken)
    .header("Content-Type", "application/json")
    .GET()
    .build();
HttpResponse<String> resp = HttpClient.newHttpClient()
    .send(req, BodyHandlers.ofString());

Integrate in 3 steps

  1. Sign up at accounts.whitebooks.in — sandbox credentials issued instantly, no sales gate.
  2. Make your first call against the sandbox base URL using the code example above. Validate against your local model.
  3. Move to production once your tests pass — switch host to https://api.whitebooks.in/einvoice. Same payload, same response shape.

Frequently asked questions

What's the QR image format?

300×300 PNG by default, base64-encoded. Pass format=svg or format=jpeg for alternatives.

What signature does NIC use?

RSA-2048 with SHA-256, returned as JWS (JSON Web Signature). NIC's public key is available at NIC e-Invoice portal for verification.

Can I verify the QR offline?

Yes — verify the JWS using NIC's published public key. WhiteBooks ships verification helpers in all 6 SDKs.

Are QR codes cached?

Yes — once retrieved, the QR is cached in WhiteBooks for 30 days. Re-fetches are served from cache (no NIC traffic).

Explore the full e-Invoice API

This is one endpoint inside the WhiteBooks e-Invoice API suite. See the full documentation — every endpoint, every parameter, every error code.

Open the e-Invoice API page →

Related e-Invoice API endpoints

IRN Generation API → IRN Cancellation API → Bulk IRN Generation API (1,000/call) → Signed JSON Invoice API →