QR Code API
Encode URLs, contact details, Wi-Fi credentials or any text as a QR code. Choose the output size, error-correction level, colours and quiet zone, and receive a PNG image straight back in the response. The service only encodes the string you send: it never visits the URLs you encode.
Who it is for: Developers adding QR codes to tickets, packaging, invoices, marketing material or app onboarding flows.
Benefits
- One authenticated POST returns a ready-to-use PNG.
- Four error-correction levels for print and screen use.
- Custom foreground and background colours.
- Predictable pricing: one credit per successful image.
Features and formats
- PNG output from 64 to 2048 pixels
- Error correction: low, medium, quartile, high
- Hex foreground and background colours
- Optional quiet-zone margin
- Up to 2,048 bytes of encoded data
Output formats: PNG
Common use cases
- Event tickets and boarding passes
- Product packaging and labels
- Payment and invoice links
- Restaurant menus and table ordering
- Two-factor enrolment and device pairing
Endpoints
| Method | Path | Permission | Price |
|---|---|---|---|
| /api/v1/qrcode | qrcode.generate | 1 credit |
Authentication
Send your API key secret as a bearer token. The key's role must include the operation's permission. Authentication guide.
Authorization: Bearer YOUR_SECRET_KEY
Content-Type: application/json
Example: Generate a QR code
curl -X POST https://webknx.com/api/v1/qrcode \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"data":"https://example.com","format":"png","size":512,"error_correction":"high","foreground":"#000000","background":"#FFFFFF","margin":true}'
Success: 200 image/png. Errors return JSON with a documented error.code, for example:
{
"error": {
"code": "credits_exhausted",
"message": "The workspace has insufficient credits.",
"request_id": "req_01jaexample"
}
}
Changelog
- v1.0.0 (2026-10-18): Initial release: PNG output, colours, error correction and margin control.