Tools — decode QR / signed invoice, render QR image

The /v1/tools/* endpoints are stateless utilities. They don't operate on a stored e-invoice — you hand them an IRP-signed payload and get back the decoded value or a rendered image. Useful when:

  • You receive a customer's printed invoice and need to verify the QR.
  • You're storing your own copy of the signed JSON and need to re-extract fields.
  • You need a QR image for a JWS that wasn't generated through OneFinOps.

Each call requires:

  • A standard OAuth bearer token (the same token you use for /v1/einvoices).
  • A Gstin: <15-char> request header — picks which IRP credential to authenticate to the vendor with.

Decode a signed QR JWS

POST /v1/tools/qr/decode
Authorization: Bearer <token>
Gstin: 29ABCDE1234F1Z5
Content-Type: application/json

{ "signedQrCode": "eyJhbGciOiJSUzI1NiI..." }
{
  "sellerGstin": "29ABCDE1234F1Z5",
  "buyerGstin": "27FGHIJ5678K1Z2",
  "documentNumber": "INV-2026-00001",
  "documentType": "INV",
  "documentDate": "2026-05-04",
  "totalInvoiceValue": 11800.0,
  "itemCount": 1,
  "mainHsnCode": "998314",
  "irn": "8f3a1c0e9b6d4f7a8c2b1e5f3d9a4c0b8f3a1c0e9b6d4f7a8c2b1e5f3d9a4c0b",
  "irnDate": "2026-05-04"
}

Operation: decodeQr.

Decode a signed invoice JWS

POST /v1/tools/signed-invoice/decode
Authorization: Bearer <token>
Gstin: 29ABCDE1234F1Z5
Content-Type: application/json

{ "signedInvoice": "eyJhbGciOiJSUzI1NiI..." }
{
  "decodedJson": "{\"Irn\":\"8f3a...\",\"Version\":\"1.1\",\"ItemList\":[...]}"
}

decodedJson is the raw JSON the IRP signed. Re-parse on the client side if you need a typed view.

Operation: decodeSignedInvoice.

Render a signed QR JWS as an image

POST /v1/tools/qr/render
Authorization: Bearer <token>
Gstin: 29ABCDE1234F1Z5
Content-Type: application/json

{
  "signedQrCode": "eyJhbGciOiJSUzI1NiI...",
  "width": 256,
  "height": 256,
  "imageType": "png"
}

Returns the rendered image bytes with the matching Content-Type header (image/png or image/jpeg).

For QR images of e-invoices stored in OneFinOps, prefer the simpler GET /v1/einvoices/{irn}/qr-image — it derives the credential from the stored record so you don't need the Gstin header.

Operation: renderQr.