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
| Code | Description |
|---|---|
| 200 | QR payload generated successfully |
| 400 | Invalid keys file, payload, or encryption input |
| 409 | QR code already exists for the supplied IRN |
| 422 | Validation error |
| 500 | Local 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
irnmust be a valid generated Invoice Reference Number.timestampshould be provided as a Unix timestamp.- Set
skip_qrtotrueif 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.