Create QR Code
Create a single QR code.
POST /api/v1/qrcodesRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | QR code type. See QR Types |
content | object | Yes | Content fields for the QR type |
name | string | No | Display name (max 100 chars, defaults to "{type} QR Code") |
is_dynamic | boolean | No | true for trackable QR code with short URL (default: false) |
folder_id | string | No | Folder UUID to organize the QR code |
style | object | No | Styling options. See Styling |
Example Request
bash
curl -X POST https://api.qbar-scanner.com/api/v1/qrcodes \
-H "Content-Type: application/json" \
-H "X-API-Key: qbar_your_key_here" \
-d '{
"type": "url",
"content": {
"url": "https://example.com/landing"
},
"name": "Landing Page QR",
"is_dynamic": true,
"style": {
"dotsOptions": {
"type": "rounded",
"color": "#1a1a2e"
},
"cornersSquareOptions": {
"type": "extra-rounded",
"color": "#667eea"
},
"backgroundOptions": {
"color": "#ffffff"
}
}
}'Response 201 Created
json
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "url",
"name": "Landing Page QR",
"content_string": "https://example.com/landing",
"is_dynamic": true,
"status": "active",
"scans": 0,
"short_code": "aB3cD4eF",
"dynamic_url": "https://qbar-scanner.com/r/aB3cD4eF",
"image_url": "https://api.qbar-scanner.com/api/v1/qrcodes/550e.../image",
"created_at": "2025-01-15T10:30:00.000Z",
"request_id": "..."
}Key Behaviors
- Static QR codes encode content directly in the QR image. If you update the content, the image changes — but already-printed QR codes still point to the old content.
- Dynamic QR codes encode a short redirect URL. Scanning always goes through the redirect, so you can update the target content without reprinting.
- The
image_urlfield provides a ready-to-use link to render the QR SVG image.
Error Responses
| Status | When |
|---|---|
400 | Validation error (missing/invalid fields) |
401 | Invalid API key |
429 | Rate limited |