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/calderaxe/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 up to 100 QR codes in one call (POST /api/v1/qr/batch). Each code is stored as a private file of your organisation (PNG or SVG) with a time-limited, read-only link; zip: true also stores one zip of them all; the answer's zip is null when it was not asked for, when nothing was generated, or when the zip could not be built or stored (the request still succeeds, and the images are stored), so check it before using it. Results come back in request order, one per item: an item that fails (status: 'failed', error.code VALIDATION_ERROR or STORAGE_FAILED) never fails the call. Each item is { entityType, entityId?, accessCode?, baseUrl?, options? }; see Batch QR Generation for the item rules, the processor settings it honours and every error code.

The SDKs wait up to 65 seconds for this call and never answer it with a fail-open placeholder. Pass an idempotency key so a retry returns the stored answer instead of storing every code again. Without a key, the TypeScript and Go SDKs re-send only after a 429; the Python SDK does not re-send at all (a 429 is raised with its retry_after). With a key, the TypeScript and Go SDKs retry as for any call, and the Python SDK re-sends only when no answer came back (a network failure or its own timeout); a re-send that reaches the server while the first request is still running gets 409 CONFLICT: call again with the same key after about 30 seconds. An answer in which no code was generated is never stored, so a retry with the same key runs the batch again; to re-send the failed items of a partial batch, use a new key.

const batch = await client.qr.generateBatch(
  {
    items: [
      { entityType: 'PROPERTY', entityId: 'prop_001' },
      { entityType: 'PROPERTY', entityId: 'prop_002', options: { size: 'flyer', errorCorrection: 'M' } },
      { entityType: 'PRINCIPAL', accessCode: 'A1B2', baseUrl: 'https://lettings.example.com' },
    ],
    format: 'svg',
    zip: true,
    urlTtlSeconds: 3600,
  },
  { idempotencyKey: 'flyer-batch-2026-11' },
);

for (const item of batch.items) {
  if (item.status === 'generated') console.log(item.index, item.targetUrl, item.signedUrl);
  else console.warn(item.index, item.error.code, item.error.message);
}
console.log(batch.totalGenerated, batch.totalFailed, batch.zip?.signedUrl);
batch = client.qr.generate_batch(
    [
        {"entityType": "PROPERTY", "entityId": "prop_001"},
        {"entityType": "PROPERTY", "entityId": "prop_002", "options": {"size": "flyer"}},
        {"entityType": "PRINCIPAL", "accessCode": "A1B2", "baseUrl": "https://lettings.example.com"},
    ],
    format="svg",
    zip=True,
    url_ttl_seconds=3600,
    idempotency_key="flyer-batch-2026-11",
)
for item in batch["items"]:
    print(item["index"], item["status"], item.get("signedUrl") or item["error"]["code"])
batch, err := client.Qr.GenerateBatchItems(platformxe.QrBatchInput{
    Items: []platformxe.QrBatchItem{
        {EntityType: "PROPERTY", EntityID: "prop_001"},
        {EntityType: "PROPERTY", EntityID: "prop_002", Options: &platformxe.QrBatchItemOptions{Size: "flyer"}},
        {EntityType: "PRINCIPAL", AccessCode: "A1B2", BaseURL: "https://lettings.example.com"},
    },
    Format:        "svg",
    Zip:           true,
    URLTTLSeconds: 3600,
}, &platformxe.QrBatchCallOptions{IdempotencyKey: "flyer-batch-2026-11"})
if err != nil {
    log.Fatal(err)
}
for _, item := range batch.Items {
    if item.Status == "generated" {
        fmt.Println(item.Index, item.SignedURL)
    } else {
        fmt.Println(item.Index, item.Error.Code, item.Error.Message)
    }
}

In Go, GenerateBatch(map[string]interface{}) still posts a map you build yourself to the same route; GenerateBatchItems is the typed form. The result's Results and Errors fields are deprecated: the route answers Items.

Available from TypeScript SDK 1.18.0, Python 1.14.0 and Go v1.14.0 (pending release). Requires the storage:upload scope; 120 requests/hr per API key. For a pxk_dev_ sandbox key each call counts one of its 50 daily storage:upload writes per item, plus one for the zip; a batch that does not fit is refused whole (429 SANDBOX_QUOTA_EXCEEDED).

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()storage:upload (120/hr per API key)
qr.getProcessor()qr:manage
qr.updateProcessor()qr:manage