{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shieldz-cash/json-schema/shieldz-cash-product-create-schema.json",
  "title": "ProductCreate",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shieldz-cash-openapi.json#/components/schemas/ProductCreate",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 250,
      "description": "What the buyer sees, e.g. \"Blue hoodie\"."
    },
    "description": {
      "type": "string",
      "maxLength": 2000,
      "description": "Optional, shown under the name."
    },
    "image_url": {
      "type": "string",
      "format": "uri",
      "description": "A public https image URL. To upload a file instead, use the dashboard (Products → image)."
    },
    "default_price_data": {
      "$ref": "#/$defs/PriceData",
      "description": "Create the product's price in the same call. It becomes default_price."
    },
    "idempotency_key": {
      "type": "string",
      "maxLength": 256,
      "description": "Retrying with the same key returns the first object (200, idempotent_replay: true) instead of creating another. The SDKs add one for you."
    }
  },
  "$defs": {
    "PriceData": {
      "type": "object",
      "description": "Send exactly one of unit_amount_usd_cents (a fixed price) or custom_unit_amount (the customer chooses, e.g. tips or donations).",
      "properties": {
        "unit_amount_usd_cents": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000,
          "description": "Fixed price per unit in USD cents: 4999 is $49.99. A checkout's total must come to $1 or more."
        },
        "custom_unit_amount": {
          "type": "object",
          "description": "The customer types an amount between minimum and maximum. A link line with this price has a fixed quantity of 1.",
          "properties": {
            "minimum_usd_cents": {
              "type": "integer",
              "minimum": 100,
              "default": 100,
              "description": "Lowest amount the customer may enter, in cents (at least $1)."
            },
            "maximum_usd_cents": {
              "type": "integer",
              "maximum": 10000000,
              "default": 10000000,
              "description": "Highest amount, in cents (at most $100,000)."
            },
            "preset_usd_cents": {
              "type": "integer",
              "description": "Amount pre-filled on the page. Must sit between minimum and maximum."
            }
          }
        }
      }
    }
  }
}