PlatformXeDocs
Get API Key

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.

SDKInstallNamespace
TypeScriptnpm install @caldera/platformxe-sdkclient.qr
Pythonpip install platformxeclient.qr
Gogo get github.com/calderax/platformxe-goclient.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

FieldTypeRequiredDescription
datastringYesThe content to encode in the QR code
sizenumberNoImage width/height in pixels (default: 256)
formatstringNoOutput format: png or svg (default: png)
labelstringNoOptional text label rendered below the QR code
foregroundstringNoForeground color as hex (default: #000000)
backgroundstringNoBackground 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

MethodScope
qr.generate()templates:read
qr.generateBatch()templates:read
qr.getProcessor()templates:read
qr.updateProcessor()templates:write