Skip to content

E-invoicing

Get invoice QR code

Get the QR code for an invoice as a base64 image, together with its encrypted invoice data.

GET{baseUrl}/{stage}/external/businesses/{businessId}/invoices/{invoiceIrn}/qr

Retrieve the QR code for a specific invoice, including encrypted invoice data and base64-encoded QR image.

Request

Headers

Content-Typerequired
application/json or */*
Acceptrequired
application/json or */*
X-Business-Keyrequired

Path Parameters

businessIdstring (UUID)required
Your business FIRS ID
invoiceIrnstringrequired
Invoice Reference Number

Example: INV237-1070ECE8-20250826

Response

Success (200)

JSON
{
  "responseCode": "00",
  "responseMessage": "QR code retrieved successfully",
  "data": {
    "irn": "INV237-1070ECE8-20250826",
    "qrCodeBase64": "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEA...",
    "encryptedDataBase64": "eyJpbnZvaWNlSWQiOiIxMjMi...",
    "timestamp": 1693046835000
  }
}
qrCodeBase64string
Base64-encoded PNG image of QR code
encryptedDataBase64string
Encrypted invoice data (for verification)
irnstring
Invoice Reference Number (confirmation)
timestampnumber
Unix timestamp of generation

Errors

404 - Invoice Not Found

JSON
{
  "responseCode": "404",
  "responseMessage": "Invoice not found with IRN: INV999-INVALID"
}

→ Verify invoiceIrn exists and belongs to businessId

403 - QR Code Disabled

JSON
{
  "responseCode": "403",
  "responseMessage": "QR code generation disabled for this business"
}

→ Enable QR code feature in business settings or contact support

422 - Invoice Not Eligible

JSON
{
  "responseCode": "422",
  "responseMessage": "Invoice not eligible for QR code generation"
}

→ Invoice must be finalized and not cancelled

Example Request

cURL
curl -X GET "{baseUrl}/{stage}/external/businesses/26ede24b-ac50-475f-aacc-5ea6339f0863/invoices/INV237-1070ECE8-20250826/qrcode" \
  -H "Authorization: Bearer BK_QUBYK4S2X97J"

Using the QR Code

Display in HTML

JavaScript
<img src="data:image/png;base64,{qrCodeBase64}" alt="Invoice QR Code" />

Display in JavaScript

JavaScript
const img = document.createElement('img');
img.src = `data:image/png;base64,${response.data.qrCodeBase64}`;
img.alt = 'Invoice QR Code';
document.body.appendChild(img);

Save to File (Node.js)

JavaScript
const fs = require('fs');
const buffer = Buffer.from(response.data.qrCodeBase64, 'base64');
fs.writeFileSync('invoice-qr.png', buffer);

QR Code Contents

The QR code contains encrypted invoice data that can be scanned for verification:

  • Invoice Reference Number (IRN)
  • Invoice amount and currency
  • Supplier TIN
  • Issue date
  • Digital signature for authenticity

Decryption: Requires your business's QR code certificate (configured in business settings)

Prerequisites

  • Business must have QR code generation enabled in settings
  • QR code public key and certificate configured
  • Invoice must be finalized (not draft or cancelled)

Enable QR Codes: POST /businesses/{businessId}/settings with qrCodePublicKey and qrCodeCertificate

Common Issues

QR code not generating → Check business settings have QR certificate configured

"Invoice not eligible" → Invoice must be in PENDING, PAID, or APPROVED status

QR code not displaying → Verify base64 string is complete and properly formatted

Security Notes

  • QR codes contain encrypted invoice data
  • Always use HTTPS to retrieve QR codes
  • Validate business ownership before generating QR codes
  • QR codes are generated on-demand (not cached)