{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/qr-manager-ai/json-schema/qr-manager-ai-create-qr-code-body-schema.json",
  "title": "CreateQrCodeBody",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/qr-manager-ai-openapi.yml#/components/schemas/CreateQrCodeBody",
  "type": "object",
  "properties": {
    "qrType": {
      "$ref": "#/$defs/QrType",
      "default": "URL"
    },
    "title": {
      "type": "string",
      "description": "Human-readable label shown in the dashboard."
    },
    "fgColor": {
      "type": "string",
      "description": "Foreground colour (6-digit hex). Defaults to `#000000`.",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "bgColor": {
      "type": "string",
      "description": "Background colour (6-digit hex). Defaults to `#ffffff`.",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "dotStyle": {
      "$ref": "#/$defs/DotStyle"
    },
    "cornerStyle": {
      "$ref": "#/$defs/CornerStyle"
    },
    "cornerDotType": {
      "$ref": "#/$defs/CornerDotType"
    },
    "eyeOuterColor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Hex colour override for the eye outer squares.",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "eyeInnerColor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Hex colour override for the eye inner dots.",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "gradientType": {
      "$ref": "#/$defs/GradientType",
      "nullable": true,
      "description": "Gradient direction. Requires `gradientEndColor`."
    },
    "gradientEndColor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Second colour for the dot gradient (6-digit hex). Required when `gradientType` is set.",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "errorCorrectionLevel": {
      "$ref": "#/$defs/ErrorCorrectionLevel"
    },
    "logoSize": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0.1,
      "maximum": 0.4,
      "description": "Logo size as a fraction of the QR code width (0.1–0.4). Requires a logo to be set via the dashboard."
    },
    "logoMargin": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 20,
      "description": "Padding (px) between the logo and surrounding dots."
    },
    "frameStyle": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 16,
      "description": "Frame template number (1–16). Omit for no frame."
    },
    "frameColor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Hex colour for the frame. Only used when `frameStyle` is set.",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "frameText": {
      "type": [
        "string",
        "null"
      ],
      "description": "Label text in the frame (max 50 chars). Only used when `frameStyle` is set."
    },
    "qrShape": {
      "$ref": "#/$defs/QrShape"
    },
    "roundSize": {
      "type": "boolean",
      "description": "Smooth dot edges. Automatically enabled for `circle` shape. Defaults to `false`."
    },
    "hideBackgroundDots": {
      "type": "boolean",
      "description": "Hide QR dots behind the logo area. Defaults to `true`."
    },
    "bgRound": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 1,
      "description": "Background corner rounding (0 = square corners, 1 = fully rounded)."
    },
    "outerMargin": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 40,
      "description": "Extra whitespace (px) around the outside of the QR code."
    },
    "maxScans": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "description": "Stop redirecting after this many scans."
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Stop redirecting after this datetime (ISO 8601)."
    },
    "folder": {
      "type": [
        "string",
        "null"
      ],
      "description": "Folder name to place the QR code in. Must already exist."
    },
    "redirectUrl": {
      "type": "string",
      "description": "**URL and SHORTLINK types — required.** The destination to redirect to."
    },
    "utmSource": {
      "type": "string",
      "description": "**URL type only.** Appended as `utm_source` to redirectUrl."
    },
    "utmMedium": {
      "type": "string",
      "description": "**URL type only.** Appended as `utm_medium` to redirectUrl."
    },
    "utmCampaign": {
      "type": "string",
      "description": "**URL type only.** Appended as `utm_campaign` to redirectUrl."
    },
    "vcardName": {
      "type": "string",
      "description": "**VCARD type — required.** Full name."
    },
    "vcardOrg": {
      "type": "string",
      "description": "**VCARD type.** Organisation."
    },
    "vcardPhone": {
      "type": "string",
      "description": "**VCARD type.** Phone number."
    },
    "vcardEmail": {
      "type": "string",
      "description": "**VCARD type.** Email address."
    },
    "vcardUrl": {
      "type": "string",
      "description": "**VCARD type.** Website URL."
    },
    "vcardAddress": {
      "type": "string",
      "description": "**VCARD type.** Street address."
    },
    "wifiSsid": {
      "type": "string",
      "description": "**WIFI type — required.** Network name (SSID)."
    },
    "wifiPassword": {
      "type": "string",
      "description": "**WIFI type.** Network password."
    },
    "wifiSecurity": {
      "type": "string",
      "enum": [
        "WPA",
        "WEP",
        "nopass"
      ],
      "default": "WPA",
      "description": "**WIFI type.** Security protocol."
    },
    "smsPhone": {
      "type": "string",
      "description": "**SMS type — required.** Recipient phone number."
    },
    "smsMessage": {
      "type": "string",
      "description": "**SMS type.** Pre-filled message body."
    },
    "emailTo": {
      "type": "string",
      "description": "**EMAIL type — required.** Recipient email address."
    },
    "emailSubject": {
      "type": "string",
      "description": "**EMAIL type.** Pre-filled subject line."
    },
    "emailBody": {
      "type": "string",
      "description": "**EMAIL type.** Pre-filled email body."
    },
    "phone": {
      "type": "string",
      "description": "**PHONE type — required.** Phone number to dial."
    }
  },
  "$defs": {
    "CornerDotType": {
      "type": "string",
      "enum": [
        "square",
        "extra-rounded",
        "dot",
        "dots",
        "rounded",
        "classy",
        "classy-rounded"
      ],
      "default": "square",
      "description": "Style of the QR code corner finder inner dots."
    },
    "CornerStyle": {
      "type": "string",
      "enum": [
        "square",
        "extra-rounded",
        "dot",
        "dots",
        "rounded",
        "classy",
        "classy-rounded"
      ],
      "default": "square",
      "description": "Style of the QR code corner finder (eye outer) squares."
    },
    "DotStyle": {
      "type": "string",
      "enum": [
        "square",
        "dots",
        "rounded",
        "extra-rounded",
        "classy",
        "classy-rounded"
      ],
      "default": "square",
      "description": "Style of the QR code dot modules."
    },
    "ErrorCorrectionLevel": {
      "type": "string",
      "enum": [
        "L",
        "M",
        "Q",
        "H"
      ],
      "default": "M",
      "description": "Error correction capacity.\n- `L` — ~7% of codewords can be restored\n- `M` — ~15% (default)\n- `Q` — ~25%\n- `H` — ~30% (allows large logos)\n"
    },
    "GradientType": {
      "type": "string",
      "enum": [
        "linear",
        "upDown",
        "diagonal1",
        "diagonal2",
        "radial"
      ],
      "description": "Gradient direction applied to the dot modules. Requires `gradientEndColor`."
    },
    "QrShape": {
      "type": "string",
      "enum": [
        "square",
        "circle"
      ],
      "default": "square",
      "description": "Overall shape of the QR code — `square` (standard) or `circle` (circular)."
    },
    "QrType": {
      "type": "string",
      "enum": [
        "URL",
        "SHORTLINK",
        "VCARD",
        "WIFI",
        "SMS",
        "EMAIL",
        "PHONE",
        "APP_STORE",
        "SOCIAL"
      ],
      "description": "- `URL` — Dynamic redirect QR code. Destination can be updated after creation.\n- `SHORTLINK` — Short redirect URL only. No QR image; same redirect infrastructure as URL. Separate per-tier count limit.\n- `VCARD` — Contact card encoded in the QR pattern.\n- `WIFI` — WiFi credentials encoded in the QR pattern.\n- `SMS` — Pre-filled SMS encoded in the QR pattern.\n- `EMAIL` — Pre-filled email encoded in the QR pattern.\n- `PHONE` — Phone number encoded in the QR pattern.\n- `APP_STORE` — Dynamic redirect with separate iOS and Android URLs. Managed via the dashboard only.\n- `SOCIAL` — Dynamic multi-link social profile page. Managed via the dashboard only.\n"
    }
  }
}