curl --request POST \
--url https://avraapi.com/api/v1/utilities/qr/generate \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '
{
"data": "https://example.com/receipt/ORDER-2026-001"
}
'"<string>"Generate a QR code
Create a PNG, SVG, or Base64 QR code through your configured AvraAPI QR Generator.
curl --request POST \
--url https://avraapi.com/api/v1/utilities/qr/generate \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '
{
"data": "https://example.com/receipt/ORDER-2026-001"
}
'"<string>"base64 returns a PNG data URI inside the normal JSON envelope.
In the Playground, select png or svg to receive an image response, or select base64 to inspect the JSON data-URI response. Generated artifacts are real and can consume Development-project credits.
API endpoint
https://avraapi.com/api/v1/utilities/qr/generate
Request fields
| Field | Required | Rules |
|---|---|---|
data | Yes | Text to encode; 1–4,096 characters. URLs and vCards are supported as ordinary text values. |
format | No | png (default), svg, or base64. PNG and SVG return media; base64 returns JSON. |
size | No | Output size from 50 to 2,000 pixels; default 300. |
margin | No | Quiet-zone margin from 0 to 20 modules; default 2. |
foreground_color | No | Six-digit hex colour, with or without #; default black (000000). |
background_color | No | Six-digit hex colour, with or without #; default white (ffffff). |
logo_url | No | Publicly accessible HTTP or HTTPS image URL, up to 2,048 characters. A logo is applied to PNG and Base64 output; SVG does not include it. |
logo_size_percent | No | Centred-logo width from 5% to 40% of the QR width; default 20. |
privacy_mode | No | Boolean request-level privacy setting. Use the shared X-Privacy-Mode: 1 header when you need the platform-wide privacy guarantee. |
logo_url is supplied, AvraAPI fetches the image while producing the code. Use a public image you control; the logo must be reachable, use HTTP or HTTPS, and stay within the 512 KB logo limit. The QR error-correction level is raised automatically so the centred logo remains scannable.
Request example
curl --request POST "https://avraapi.com/api/v1/utilities/qr/generate" \
--header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
--header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
--header "X-ENV: development" \
--header "Accept: image/png" \
--header "Content-Type: application/json" \
--data '{
"data": "https://example.com/receipt/ORDER-2026-001",
"format": "png",
"size": 400,
"logo_url": "https://example.com/brand-mark.png",
"logo_size_percent": 20
}' \
--output order-qr.png
Media response
Forpng, the successful response body is the PNG itself with Content-Type: image/png. For svg, it is SVG media with Content-Type: image/svg+xml. Both include Content-Length, Cache-Control: no-store, Content-Disposition: inline, and X-APIX-Request-ID response headers.
There is no JSON success envelope for those image formats. Save the binary response or pass it directly to your own image pipeline; do not parse it as JSON.
Base64 JSON response
Useformat: "base64" only when a JSON data URI suits your application. It is a PNG data URI, not raw Base64 bytes.
curl --request POST "https://avraapi.com/api/v1/utilities/qr/generate" \
--header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
--header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
--header "X-ENV: development" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"data":"https://example.com/receipt/ORDER-2026-001","format":"base64"}'
{
"success": true,
"request_id": "01f00000-0000-4000-8000-000000000021",
"data": {
"format": "base64",
"data_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
}
}
Error codes
| HTTP | error.code | When it happens | What to do |
|---|---|---|---|
400 | http_error | QR generation cannot process the supplied value, colour, or logo URL. An unreachable, unsupported, or oversized logo can produce this outcome. | Correct the value or use a reachable public image, then submit a new request. |
401 | unauthorized | Credentials are missing, invalid, inactive, or do not match X-ENV. | Check your backend credential configuration. |
402 | insufficient_funds | The selected QR Generator integration requires credits that are unavailable. | Check the project balance and service configuration. |
422 | validation_failed | A field is missing or outside its documented type, size, colour, URL, or range rules. | Correct the body using the field details in the response. |
422 | provider_selection_failed | No active QR Generator integration can be selected for the project environment. | Enable or configure the QR Generator integration. |
429 | rate_limit_exceeded | The configured request limit was reached. | Respect Retry-After when present. |
500 | internal_error | The generator could not complete unexpectedly. | Retain the request ID and retry only when your workflow permits it. |
503 | project_paused | The project is paused. | Reactivate the project before retrying. |
Playground resources
The generated reference below lists this endpoint’s API standard details: request fields, authorizations, and response schema. The complete integration guide, request and response examples, and endpoint-specific error handling are above.Authorizations
Your Development project's Client ID. Enter your own value in the Documentation Playground.
Your Development project's Client Secret. Mintlify does not proxy these requests; the browser sends them directly to AvraAPI. Never enter a Production secret in the Documentation Playground.
Headers
Selects the Development credential environment. The Documentation Playground exposes Development values only; normal backend integrations may use their documented Production credentials outside this tool.
dev, development Requests a JSON response where the selected operation supports JSON.
"application/json"
Optional privacy override. Turn this on to request that AvraAPI suppress request-payload storage in observability logs for this request.
true
Body
Text, URL, vCard, or other data to encode.
1 - 4096png, svg, base64 Output size in pixels.
50 <= x <= 2000Quiet-zone margin in modules.
0 <= x <= 20^#?[0-9a-fA-F]{6}$^#?[0-9a-fA-F]{6}$A publicly accessible HTTP or HTTPS image. Used for PNG and Base64 output only.
2048Width of the centred logo as a percentage of the QR width.
5 <= x <= 40Optional request-level privacy setting. X-Privacy-Mode is the universal header override.
Response
QR output in the requested format.
The response is of type file.
Was this page helpful?
