Generate QR code
The service task "Generate QR code" creates a QR code as a PNG image from a text or an object and stores it as a file in the Pantarey storage. The image can be attached to emails, saved in records or shown in user tasks. If the QR code is to appear directly in a PDF or email template, the Handlebars helper qrCode is the shorter way, without a separate file.
Technical name prio_generateQRCode · Category in the "Select service task" dialog: Tools
When is this service used?
- Girocode on the invoice: Musterfirma GmbH creates a payment QR code (EPC format) for every invoice, which customers scan with their banking app.
- Link to the appointment confirmation: A QR code with the link to the external task is placed in the training letter.
- Device labels: For delivered hardware a QR code with serial number and customer id is created and saved as a file on the device record.
Input
| Field | Type | Required | Meaning |
|---|---|---|---|
data |
string or object | yes | Content of the QR code. An object is encoded as JSON text |
filename |
string | no | File name; default qrcode_<timestamp>.png |
options |
object | no | Appearance: errorCorrectionLevel (default M), width in pixels (default 300), margin (default 1), color with dark (default #000000) and light (default #FFFFFF). Own values override the defaults |
If color is given, both colors have to be set; the object replaces the default completely. How many characters fit into a QR code depends on content and error correction; data that is too long aborts with an error of the library.
{
"data": "BCD\n002\n1\nSCT\nAUGSDE77XXX\nMusterfirma GmbH\nDE02720500000000123456\nEUR" & $formatNumber(invoice.gross, "0.00") & "\n\n\nInvoice " & invoice.number,
"filename": "girocode-" & invoice.number & ".png",
"options": { "width": 400, "errorCorrectionLevel": "M" }
}
In the EPC format the amount uses a dot as decimal separator (EUR1190.00), without thousands separators.
Output
{
"filename": "girocode-RE-2026-0042.png",
"referenceId": "01JCX4R9M2T7V8W3Y5Z6A7B8C9",
"contentType": "image/png",
"thumbnail": "iVBORw0KGgoAAAANSUhEUg…"
}
A file object for the image in the Pantarey storage. thumbnail is a Base64-encoded preview 200 px wide; it is created for all images wider than 200 px, so always at the default width of 300. The result is stored under the result path, e.g. girocode, and can be used there as an attachment or file field.
Errors and behavior
- Missing input throws
No data provided for QR-Code generation. - Library errors (data too long, invalid option) throw as well. With an error boundary event the process continues there; without one the instance ends in error with a resume point and an error email to the process owner.
- The service never returns
{status, message}. - Time limit 900 seconds. Retries for transient errors (up to three attempts) create at most a second file.
- In the dry run no file is created; the step returns a sample output from the catalog.
Example
Invoice run at Musterfirma GmbH: The message contains invoice with number and gross.
- Generate QR code with the input above, result path
girocode. - Output as above,
girocode.filename=girocode-RE-2026-0042.png. - Next step: Send email to external recipients (own domain) attaches
invoice.pdfandgirocode; a database step saves the image in the file field of the invoice.
If the code should appear on the invoice itself instead, it is created in the PDF template with {{qrCode …}}, see GiroCode example.
Frequently asked questions
After setting color.dark the background is transparent or black.
color replaces both default colors. Always specify dark and light together, e.g. { "dark": "#1a3c6e", "light": "#FFFFFF" }.
The banking app does not recognize the Girocode.
The EPC format is line-exact: amount as EUR plus number with a dot (EUR1190.00), no thousands separator, lines separated by \n. Take over the line structure from the example above.
What is thumbnail for?
For display in lists and forms without loading the image. To pass the file on, the file object of filename, referenceId and contentType is sufficient.
Next step
Handlebars helpers: create QR codes directly in PDF and email templates.