RESTJSONHTTPSBearer
REST API
Generate QR codes from your apps. One production endpoint today — POST /api/v1/generate. OpenAPI-style discovery via GET /api/v1/generate.
Introduction
How the API fits into QR TheCode²
Authenticate with a Bearer API key (Business plan). The API creates QR codes in your account and returns the image as a base64 PNG data URL or SVG string.
Discovery
GET https://qrthecode2.com/api/v1/generateCreate QR
POST https://qrthecode2.com/api/v1/generateAuthentication
Send your API key in the Authorization header.
Headers
Authorization: Bearer qrm_your_api_key
Content-Type: application/jsonNever expose API keys in front-end code or public repos. Use server-side calls and environment variables.
Generate a QR code
POST
/api/v1/generateBody (JSON)
| Field | Required | Description |
|---|---|---|
| type | No | QR type (default URL). See data schemas. |
| data | Yes | Payload for the chosen type (e.g. { "url": "https://…" }). |
| name | No | Label in your dashboard. |
| isDynamic | No | Dynamic QR with scan URL and stats (Business). |
| fgColor / bgColor | No | Hex colors (#000000, #ffffff). |
| format | No | png (default) or svg. |
cURL
curl -X POST https://qrthecode2.com/api/v1/generate \
-H "Authorization: Bearer qrm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "URL",
"data": { "url": "https://example.com" },
"name": "Homepage QR",
"fgColor": "#001533",
"bgColor": "#ffffff",
"format": "png"
}'Response (201)
JSON
{
"id": "clx…",
"name": "Homepage QR",
"type": "URL",
"isDynamic": false,
"shortCode": null,
"scanUrl": null,
"qrImage": "data:image/png;base64,iVBOR…",
"format": "png",
"createdAt": "2026-03-12T10:00:00.000Z"
}Data schemas
Fields inside the data object per type
Loading schemas from the API…
Errors
HTTP status codes returned by the API
| HTTP | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 403 | Business plan required |
| 429 | QR code limit reached |
| 500 | Internal server error |
Ready to integrate?
Upgrade to Business, create an API key, and call the endpoint from your backend.