{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sudomock-com/json-schema/sudomock-com-photo-mockup-create-request-schema.json",
  "title": "PhotoMockupCreateRequest",
  "description": "Create a reusable photo mockup from one source image.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sudomock-com-photo-mockups-api-openapi.yml#/components/schemas/PhotoMockupCreateRequest",
  "properties": {
    "source_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Public HTTPS URL of the source image."
    },
    "source_base64": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Base64-encoded source image, with or without a data URL prefix."
    },
    "name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional display name for the mockup."
    },
    "is_async": {
      "type": "boolean",
      "description": "If true, the mockup is QUEUED and the call returns 202 immediately with a job_id (poll GET /api/v1/jobs/{job_id}, or receive a webhook if one is configured); result_url carries the new mockup_uuid on success. If false (default), the create runs synchronously and returns the mockup.",
      "default": false
    },
    "print_areas": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/PhotoMockupPrintAreaInput"
          },
          "type": "array",
          "maxItems": 8,
          "minItems": 1
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional: 1-8 convex four-point printable areas in source-image pixels. When provided, these areas are used verbatim and automatic print-area detection is skipped."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "$defs": {
    "PhotoMockupPrintAreaInput": {
      "properties": {
        "points": {
          "items": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "type": "array",
          "maxItems": 4,
          "minItems": 4,
          "description": "Four [x, y] points in image coordinates."
        },
        "name": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional print-area label, e.g. \"Front\" or \"Back\"."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "points"
      ],
      "title": "PhotoMockupPrintAreaInput",
      "description": "Four image coordinates defining one printable area."
    }
  }
}