{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/woocommerce/json-schema/woocommerce-product-variation-input-schema.json",
  "title": "ProductVariationInput",
  "description": "Input for creating or updating a product variation.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/woocommerce-product-variations-api-openapi.yml#/components/schemas/ProductVariationInput",
  "type": "object",
  "properties": {
    "sku": {
      "type": "string",
      "description": "SKU for this variation."
    },
    "regular_price": {
      "type": "string",
      "description": "Regular price."
    },
    "sale_price": {
      "type": "string",
      "description": "Sale price."
    },
    "status": {
      "type": "string",
      "description": "Variation status.",
      "enum": [
        "draft",
        "pending",
        "private",
        "publish"
      ]
    },
    "manage_stock": {
      "type": "boolean",
      "description": "Whether to enable stock management."
    },
    "stock_quantity": {
      "type": "integer",
      "description": "Stock quantity."
    },
    "stock_status": {
      "type": "string",
      "description": "Stock status.",
      "enum": [
        "instock",
        "outofstock",
        "onbackorder"
      ]
    },
    "image": {
      "$ref": "#/$defs/ProductImage"
    },
    "attributes": {
      "type": "array",
      "description": "Attribute options for this variation.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Attribute ID."
          },
          "name": {
            "type": "string",
            "description": "Attribute name."
          },
          "option": {
            "type": "string",
            "description": "Selected option value."
          }
        }
      }
    }
  },
  "$defs": {
    "ProductImage": {
      "type": "object",
      "description": "An image associated with a product.",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Image unique identifier."
        },
        "src": {
          "type": "string",
          "format": "uri",
          "description": "Image URL."
        },
        "name": {
          "type": "string",
          "description": "Image name."
        },
        "alt": {
          "type": "string",
          "description": "Image alternative text."
        }
      }
    }
  }
}