Skip to content

QrConfig reference

The body you POST to /api/qr/generate (and that templates and the AI endpoint override). Anything left unset falls back to the engine default — there is no required field beyond content.

Source of truth: Models/QrModels.cs in the .NET backend. The list below covers every public field; for a full schema dump including types and nullability run pnpm docs:schema in the frontend repo, which regenerates this page from the C# models.

Content

FieldTypeDefaultNotes
contentstringrequiredURL or text to encode. Max 4296 chars.
eccLevelenumMError correction. L 7% · M 15% · Q 25% · H 30%. Bump to H when adding a logo.

Output

FieldTypeDefaultNotes
fileFormatenumpngpng, jpg, svg, pdf, webp.
responseTypeenumbase64base64 returns JSON; binary returns the raw file.
outputWidthint800Pixels. Up to 4096.
outputHeightint—Defaults to outputWidth. Override only if you need non-square.
pixelsPerModuleint10Resolution per QR module. Bumps outputWidth if not set.
qualityint90JPG/WebP quality 1–100.
transparentBackgroundboolfalsePNG/SVG/WebP only.

Colors

FieldTypeDefaultNotes
primaryColorhex#000000Module color. #RGB, #RRGGBB, #RRGGBBAA.
secondaryColorhex—Used by gradients and connected modules.
backgroundColorhex#FFFFFFQuiet zone color.
foregroundStyleenumsolidsolid, linearGradient, radialGradient, sweepGradient.
gradientTypeenumlinearSame as foregroundStyle shorthand.
gradientDirectionenumverticalvertical, horizontal, diagonal, diagonal-reverse.
gradientColorshex[]—2–6 stops.
gradientStopsfloat[]even0–1 positions. Must match gradientColors.length.
gradientAngleint0Degrees, overrides gradientDirection if set.

Modules (the dots)

FieldTypeDefaultNotes
qrShapeenumsquareOuter canvas: square, roundedsquare, circle.
qrShapeRadiusint0Corner radius when qrShape: roundedsquare.
moduleShapeenumsquareOne of 27. See Patterns.
moduleScalefloat1.00.5–1.0. Shrinks each module for airier looks.
moduleRotationfloat0Degrees.
moduleStyleenumsolidsolid, outline, striped.
modulePatternenumstandardstandard, checker, alternating.
moduleSizeVariationfloat00–0.3 adds organic variation per module.
connectedStyleenumnonenone, fluid, sharp, round. Joins adjacent modules.

Finder patterns (the 3 big eyes)

FieldTypeDefaultNotes
finderOuterShapeenumsquaresquare, roundedsquare, circle, diamond, octagon, target, double.
finderInnerShapeenumsquaresquare, roundedsquare, circle, diamond, star, dot.
finderOuterColorhex—Defaults to primaryColor.
finderInnerColorhex—Defaults to primaryColor.
finderStyleenumstandardstandard, flat, embossed.
FieldTypeDefaultNotes
logoUrlurl—Public URL fetched server-side. PNG/JPG/GIF/BMP/WebP, ≤ 10 MB.
logoBase64string—Inline data URI alternative.
logoFilemultipart—Binary part if using multipart/form-data.
logoShapeenumsquaresquare, circle, rounded.
logoSizePercentfloat185–30. Always raise eccLevel to H when ≥ 20.
logoBorderWidthint0Border thickness in pixels.
logoBorderColorhex#FFFFFF
logoShadowboolfalseDrop shadow under the logo.
logoBackgroundenumnonenone, solid, match-bg.
cleanBehindLogobooltrueErases modules under the logo so it doesn't fight the QR.

Text overlays

FieldTypeNotes
centerTextobjectBanner across the center: { text, color?, backgroundColor?, height?, fontSize?, bold?, fontFamily? }.
circularTextobjectText bent around the QR: { text, color?, fontSize?, position? }.
ctaTextstringCaption underneath the QR (e.g. "SCAN ME").
ctaTextStyleobject{ color?, fontSize?, fontFamily?, bold?, italic? }.

Frames

FieldTypeNotes
frameobject{ enabled, shape, color, width, padding, cornerRadius, fillColor? }. Shapes: rectangle, speech-bubble, badge, shield, circle.

Background image

FieldTypeNotes
backgroundImageUrl / backgroundImageBase64url/stringSoft image rendered behind the QR.
backgroundImageBlendModeenumnormal, multiply, screen, overlay.
backgroundImageOpacityfloat0–1.
backgroundImageBlurintPixels.
backgroundImageFitenumcover, contain, stretch.

Effects

FieldTypeNotes
shadowobject{ color, blur, offsetX, offsetY }.
glowobject{ color, blur, intensity }.
embossobject{ depth, lightAngle, lightColor?, shadowColor? }.
noisefloat0–0.3 adds film grain.
blurintPixels.
edgeFadefloat0–0.5 fades the canvas edge.
colorFilterenumnone, sepia, bw, cool, warm.

AI-specific (only on /api/qr/ai/generate*)

FieldTypeNotes
promptstringPlain-language description.
stylePresetenumminimal, artistic, corporate, playful, luxury, tech, nature.
creativityfloat0–1. Controls LLM temperature + boldness.
strictScannabilityboolWhen true, engine auto-fixes ECC/contrast.
llmProviderenumMarketplace only: openai, anthropic, google, mistral, cohere, groq.
llmApiKeystringMarketplace only. Forwarded once, never logged.
llmModelstringOptional; defaults to provider flagship cheap model.

Validation order

  1. JSON well-formed → INVALID_JSON if not.
  2. Field types + bounds → VALIDATION_ERROR with details[].
  3. Color contrast → LOW_CONTRAST if < 4:1 and strictScannability: true.
  4. Logo size vs ECC → LOGO_TOO_LARGE if too aggressive.
  5. ISO 18004 decode round-trip → QR_GENERATION_FAILED if the rendered output can't be re-read.

See Errors for the full error code matrix.

Regenerating this page

cd frontend
pnpm docs:schema   # reads ../Models/QrModels.cs and rewrites this file

The script is tools/gen-docs-schema.ts. Any field added to the C# model with a [Description] attribute shows up here automatically.