QR Codes
SDK methods for generating single and batch QR codes.
The client.qr namespace provides typed methods for generating QR codes individually or in batch. Available in TypeScript, Python, and Go SDKs.
| SDK | Install | Namespace |
|---|---|---|
| TypeScript | npm install @caldera/platformxe-sdk | client.qr |
| Python | pip install platformxe | client.qr |
| Go | go get github.com/calderax/platformxe-go | client.Qr |
Generate a QR code
Generate a single QR code from a data payload.
const result = await client.qr.generate({
data: 'https://booking.example.com/checkin/BK-2026-00451',
size: 300,
format: 'png',
label: 'Scan to check in',
});
console.log(result.url); // URL to the generated image
console.log(result.dataUri); // Base64 data URI for inline use
result = client.qr.generate(
data="https://booking.example.com/checkin/BK-2026-00451",
size=300,
format="png",
label="Scan to check in",
)
result, err := client.Qr.Generate(map[string]interface{}{
"data": "https://booking.example.com/checkin/BK-2026-00451",
"size": 300,
"format": "png",
"label": "Scan to check in",
})
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
data | string | Yes | The content to encode in the QR code |
size | number | No | Image width/height in pixels (default: 256) |
format | string | No | Output format: png or svg (default: png) |
label | string | No | Optional text label rendered below the QR code |
foreground | string | No | Foreground color as hex (default: #000000) |
background | string | No | Background color as hex (default: #FFFFFF) |
Generate batch
Generate multiple QR codes in a single request. Returns an array of results in the same order as the input items.
const result = await client.qr.generateBatch({
items: [
{ data: 'https://example.com/unit/4a', label: 'Unit 4A' },
{ data: 'https://example.com/unit/4b', label: 'Unit 4B' },
{ data: 'https://example.com/unit/5a', label: 'Unit 5A' },
],
size: 200,
format: 'svg',
});
for (const qr of result.codes) {
console.log(`${qr.label}: ${qr.url}`);
}
result = client.qr.generate_batch(
items=[
{"data": "https://example.com/unit/4a", "label": "Unit 4A"},
{"data": "https://example.com/unit/4b", "label": "Unit 4B"},
{"data": "https://example.com/unit/5a", "label": "Unit 5A"},
],
size=200,
format="svg",
)
result, err := client.Qr.GenerateBatch(map[string]interface{}{
"items": []map[string]interface{}{
{"data": "https://example.com/unit/4a", "label": "Unit 4A"},
{"data": "https://example.com/unit/4b", "label": "Unit 4B"},
{"data": "https://example.com/unit/5a", "label": "Unit 5A"},
},
"size": 200,
"format": "svg",
})
Processor configuration
Get processor config
const config = await client.qr.getProcessor();
config = client.qr.get_processor()
config, err := client.Qr.GetProcessor()
Update processor config
Configure default QR generation settings for your organization.
const updated = await client.qr.updateProcessor({
enabled: true,
config: {
defaultSize: 300,
defaultFormat: 'svg',
brandColor: '#102a4a',
},
});
updated = client.qr.update_processor(
enabled=True,
config={
"defaultSize": 300,
"defaultFormat": "svg",
"brandColor": "#102a4a",
},
)
updated, err := client.Qr.UpdateProcessor(map[string]interface{}{
"enabled": true,
"config": map[string]interface{}{
"defaultSize": 300,
"defaultFormat": "svg",
"brandColor": "#102a4a",
},
})
Scopes required
| Method | Scope |
|---|---|
qr.generate() | templates:read |
qr.generateBatch() | templates:read |
qr.getProcessor() | templates:read |
qr.updateProcessor() | templates:write |