Skip to main content

Generate Encrypted IRN QR Code

Generate an encrypted QR code payload for an IRN.

This endpoint builds the IRN-plus-timestamp payload, encrypts it with the RSA public key from the configured keys file, persists the generated artifacts, and optionally produces a QR PNG.

Endpoint

POST /api/v1/nrs/qrcode

Request Body

{
"irn": "INV000049-F6B4C898-20260327",
"skip_qr": false,
"timestamp": 1774857600
}

Response

{
"endpoint": "string",
"status_code": 0,
"ok": true,
"irn": "string",
"irn_with_timestamp": "string",
"timestamp": 0,
"payload": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"encrypted_text": "string",
"qr_code_base64": "string",
"artifacts": {
"public_key_text": "string",
"public_key_pem": "string",
"data_json": "string",
"encrypted_bin": "string",
"encrypted_text": "string",
"qr_code": "string"
}
}

Status Codes

CodeDescription
200QR payload generated successfully
400Invalid keys file, payload, or encryption input
409QR code already exists for the supplied IRN
422Validation error
500Local QR generation failure

Validation Error Example

{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string",
"input": "string",
"ctx": {}
}
]
}

Error Response Example

{
"endpoint": "string",
"status_code": 0,
"ok": false,
"error": "string"
}

Notes

  • irn must be a valid generated Invoice Reference Number.
  • timestamp should be provided as a Unix timestamp.
  • Set skip_qr to true if you only want the encrypted payload without generating a QR image.
  • QR artifacts and encrypted payload files are persisted locally.
  • The payload is encrypted using the configured RSA public key.