PlatformXeDocs
Get API Key

Batch QR Generation

API reference for generating multiple QR codes in a single request.

Generate multiple QR codes in a single API call. Each item in the batch follows the same schema as a single QR generation request.

Endpoint

POST /api/v1/qr/batch

Scope: storage:upload

Request body

FieldTypeRequiredDescription
itemsarrayYesArray of QR generation inputs (same schema as single generation)

Each item in the array has:

FieldTypeRequiredDescription
entityTypestringYesEntity type for the QR target
entityIdstringYesID of the entity
optionsobjectNoQR generation options (size, error correction, colors, UTM)

The maximum number of items per batch is controlled by the QR processor's maxBatchSize setting (default: 100).

Response

{
  "success": true,
  "data": {
    "results": [
      {
        "qrDataUrl": "data:image/png;base64,iVBORw0KGgo...",
        "targetUrl": "https://app.example.com/properties/prop_001",
        "entityType": "PROPERTY",
        "entityId": "prop_001"
      },
      {
        "qrDataUrl": "data:image/png;base64,iVBORw0KGgo...",
        "targetUrl": "https://app.example.com/properties/prop_002",
        "entityType": "PROPERTY",
        "entityId": "prop_002"
      }
    ],
    "totalGenerated": 2,
    "errors": []
  }
}
FieldTypeDescription
resultsarraySuccessfully generated QR codes
totalGeneratednumberCount of successfully generated codes
errorsstring[]Error messages for any failed items

Batch generation is partially tolerant -- individual items can fail without failing the entire batch. Check errors for any items that could not be generated.

Examples

Generate QR codes for multiple properties

curl

curl -X POST https://api.platformxe.com/api/v1/qr/batch \
  -H "Content-Type: application/json" \
  -H "x-api-key: pxk_live_your_api_key_here" \
  -d '{
    "items": [
      { "entityType": "PROPERTY", "entityId": "prop_001" },
      { "entityType": "PROPERTY", "entityId": "prop_002" },
      { "entityType": "PROPERTY", "entityId": "prop_003" },
      {
        "entityType": "PROPERTY",
        "entityId": "prop_004",
        "options": { "size": "large", "includeUtm": true, "utmCampaign": "flyer-batch" }
      }
    ]
  }'

TypeScript SDK

import { PlatformXe } from '@caldera/platformxe-sdk';

const px = new PlatformXe({ apiKey: 'pxk_live_your_api_key_here' });

const batch = await px.qr.generateBatch({
  items: [
    { entityType: 'PROPERTY', entityId: 'prop_001' },
    { entityType: 'PROPERTY', entityId: 'prop_002' },
    { entityType: 'PROPERTY', entityId: 'prop_003' },
    {
      entityType: 'PROPERTY',
      entityId: 'prop_004',
      options: { size: 'large', includeUtm: true, utmCampaign: 'flyer-batch' },
    },
  ],
});

console.log(batch.totalGenerated);
// 4

console.log(batch.errors.length);
// 0

Python SDK

from platformxe import PlatformXe

px = PlatformXe(api_key="pxk_live_your_api_key_here")

batch = px.qr.generate_batch({
    "items": [
        {"entityType": "PROPERTY", "entityId": "prop_001"},
        {"entityType": "PROPERTY", "entityId": "prop_002"},
        {"entityType": "PROPERTY", "entityId": "prop_003"}
    ]
})

print(f"Generated {batch['totalGenerated']} QR codes")

Mixed entity types

const batch = await px.qr.generateBatch({
  items: [
    { entityType: 'PROPERTY', entityId: 'prop_001' },
    { entityType: 'AGENT', entityId: 'agt_001' },
    { entityType: 'BOOKING', entityId: 'bk_001' },
  ],
});

Error responses

CodeDescription
BAD_REQUESTEmpty items array or exceeds maxBatchSize
FORBIDDENAPI key does not have the storage:upload scope
SERVICE_DISABLEDQR processor is disabled for this organization
RATE_LIMITEDRate limit exceeded