QR Code Generation
API reference for generating QR codes linked to platform entities.
Generate QR codes linked to platform entities -- properties, bookings, payments, agents, partners, and principals. Each QR code encodes a URL that resolves to the appropriate entity page in your application.
Endpoints
| Method | Path | Scope | Description |
|---|---|---|---|
| POST | /api/v1/qr | Any valid key but an MCP key | One QR code returned inline (a PNG data URI, or SVG); or, with an inputs array of up to 100 items, a data URI for each (nothing is stored) |
| POST | /api/v1/qr/batch | storage:upload | Up to 100 QR codes stored as private files with time-limited, read-only links, optionally zipped, failures reported per item. See Batch QR Generation |
Generate a QR code
POST /api/v1/qr
Scope: none: any valid API key may call it.
Request body
Single mode takes one item, checked by the same rules as a batch item; only the fields below are used.
| Field | Type | Required | Description |
|---|---|---|---|
entityType | string | Yes | Entity type for the QR target (see below) |
entityId | string | For PROPERTY, BOOKING, PAYMENT | 1 to 128 letters, digits, _, . or -; not . or .. |
accessCode | string | No | PRINCIPAL only: added to the link as ?code=. 1 to 128 characters |
baseUrl | string | No | The site the code points to: an http(s) URL of at most 512 characters |
format | string | No | dataUri (a PNG data URI, the default) or svg |
options.size | string or integer | No | display (128 px), print (256 px), flyer (400 px), or an integer from 64 to 1024 |
options.errorCorrection | string | No | L, M, Q or H. Default H |
options.margin | integer | No | Quiet zone in modules, 0 to 10. Default 2 |
options.darkColor / options.lightColor | string | No | #RRGGBB or #RRGGBBAA |
options.utmParams | object | No | source, medium, campaign (at most 100 characters each), added to the link as utm_* |
Inline batch mode: send { "inputs": [ ... ] } (at most 100 items of the same shape) instead. Each input is generated as sent; one that fails is left out of results.
Entity types
| Type | Description |
|---|---|
PROPERTY | Property listing |
BOOKING | Booking record |
PAYMENT | Payment transaction |
AGENT | Agent profile |
PARTNER | Partner profile |
PRINCIPAL | Principal (landlord) profile |
Response
{
"success": true,
"data": {
"qr": "data:image/png;base64,iVBORw0KGgoAAAANSU...",
"format": "dataUri"
}
}
| Field | Type | Description |
|---|---|---|
qr | string | A PNG data URI, or the SVG markup when format is svg |
format | string | dataUri or svg |
Inline batch mode answers { "results": { "<entityId or entityType>": "<data URI>", ... } }.
Processor configuration
The QR processor controls default generation settings. See Service Processors for the full API pattern. POST /api/v1/qr/batch honours enabled (a disabled processor answers 403 SERVICE_DISABLED), maxBatchSize, defaultFormat and defaultSize.
| Setting | Default | Description |
|---|---|---|
defaultSize | 300 | Default QR code size in pixels |
defaultFormat | "png" | Default output format: png or svg |
maxBatchSize | 100 | Maximum items per POST /api/v1/qr/batch request (1 to 100) |
Examples
Generate a property QR code
curl -X POST https://api.platformxe.com/api/v1/qr \
-H "Content-Type: application/json" \
-H "x-api-key: pxk_live_your_api_key_here" \
-d '{
"entityType": "PROPERTY",
"entityId": "prop_123",
"options": {
"size": "flyer",
"errorCorrection": "H",
"utmParams": { "source": "flyer", "campaign": "q2-2026" }
}
}'
Generate with custom colours, as SVG
curl -X POST https://api.platformxe.com/api/v1/qr \
-H "Content-Type: application/json" \
-H "x-api-key: pxk_live_your_api_key_here" \
-d '{
"entityType": "AGENT",
"entityId": "agt_456",
"format": "svg",
"options": { "darkColor": "#102A4A", "lightColor": "#FFFFFF", "size": 512 }
}'
Error responses
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid JSON or a body that is not an object; an unknown entityType; a missing entityId (property, booking, payment) or a bad one; a bad accessCode, baseUrl, format or option; more than 100 inputs. The message names the rule |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | FORBIDDEN | The key's organisation is inactive (/api/v1/qr itself needs no scope) |
| 429 | RATE_LIMITED | Over the key's budget; wait for Retry-After |
| 500 | INTERNAL_ERROR | Anything unexpected (a fixed message; details are never returned) |