WooCommerce · Schema

ProductInput

Input payload for creating or updating a product.

eCommerceOpen SourceOrdersProductsWordPress

Properties

Name Type Description
name string Product name.
type string Product type.
status string Product publication status.
featured boolean Whether the product is featured.
description string Full product description.
short_description string Short product description.
sku string Stock-keeping unit identifier.
regular_price string Regular price as a decimal string.
sale_price string Sale price as a decimal string.
virtual boolean Whether the product is virtual.
downloadable boolean Whether the product is downloadable.
manage_stock boolean Whether to enable stock management.
stock_quantity integer Stock quantity.
stock_status string Stock status.
weight string Product weight.
categories array Categories to assign to the product.
tags array Tags to assign to the product.
images array Images to attach.
attributes array Product attributes.
meta_data array Custom metadata.
View JSON Schema on GitHub

JSON Schema

woocommerce-rest-api-product-input-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woocommerce/refs/heads/main/json-schema/woocommerce-rest-api-product-input-schema.json",
  "title": "ProductInput",
  "description": "Input payload for creating or updating a product.",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Product name.",
      "example": "Example Name"
    },
    "type": {
      "type": "string",
      "description": "Product type.",
      "enum": [
        "simple",
        "grouped",
        "external",
        "variable"
      ],
      "example": "simple"
    },
    "status": {
      "type": "string",
      "description": "Product publication status.",
      "enum": [
        "draft",
        "pending",
        "private",
        "publish"
      ],
      "example": "draft"
    },
    "featured": {
      "type": "boolean",
      "description": "Whether the product is featured.",
      "example": true
    },
    "description": {
      "type": "string",
      "description": "Full product description.",
      "example": "A sample description"
    },
    "short_description": {
      "type": "string",
      "description": "Short product description.",
      "example": "A sample description"
    },
    "sku": {
      "type": "string",
      "description": "Stock-keeping unit identifier.",
      "example": "string-value"
    },
    "regular_price": {
      "type": "string",
      "description": "Regular price as a decimal string.",
      "example": "string-value"
    },
    "sale_price": {
      "type": "string",
      "description": "Sale price as a decimal string.",
      "example": "string-value"
    },
    "virtual": {
      "type": "boolean",
      "description": "Whether the product is virtual.",
      "example": true
    },
    "downloadable": {
      "type": "boolean",
      "description": "Whether the product is downloadable.",
      "example": true
    },
    "manage_stock": {
      "type": "boolean",
      "description": "Whether to enable stock management.",
      "example": true
    },
    "stock_quantity": {
      "type": "integer",
      "description": "Stock quantity.",
      "example": 1
    },
    "stock_status": {
      "type": "string",
      "description": "Stock status.",
      "enum": [
        "instock",
        "outofstock",
        "onbackorder"
      ],
      "example": "instock"
    },
    "weight": {
      "type": "string",
      "description": "Product weight.",
      "example": "string-value"
    },
    "categories": {
      "type": "array",
      "description": "Categories to assign to the product.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Category ID."
          }
        }
      },
      "example": [
        {
          "id": 1
        }
      ]
    },
    "tags": {
      "type": "array",
      "description": "Tags to assign to the product.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Tag ID."
          }
        }
      },
      "example": [
        {
          "id": 1
        }
      ]
    },
    "images": {
      "type": "array",
      "description": "Images to attach.",
      "items": {
        "type": "object",
        "description": "An image associated with a product.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Image unique identifier.",
            "example": 1
          },
          "src": {
            "type": "string",
            "format": "uri",
            "description": "Image URL.",
            "example": "https://example.com/path"
          },
          "name": {
            "type": "string",
            "description": "Image name.",
            "example": "Example Name"
          },
          "alt": {
            "type": "string",
            "description": "Image alternative text.",
            "example": "string-value"
          }
        }
      },
      "example": [
        "string-value"
      ]
    },
    "attributes": {
      "type": "array",
      "description": "Product attributes.",
      "items": {
        "type": "object",
        "description": "A product attribute with option values.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Attribute ID (0 for custom attributes).",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "Attribute name.",
            "example": "Example Name"
          },
          "position": {
            "type": "integer",
            "description": "Attribute position in the product.",
            "example": 1
          },
          "visible": {
            "type": "boolean",
            "description": "Whether the attribute is visible on the product page.",
            "example": true
          },
          "variation": {
            "type": "boolean",
            "description": "Whether the attribute is used to define variations.",
            "example": true
          },
          "options": {
            "type": "array",
            "description": "List of available options (terms) for this attribute.",
            "items": {
              "type": "string"
            },
            "example": [
              "string-value"
            ]
          }
        }
      },
      "example": [
        "string-value"
      ]
    },
    "meta_data": {
      "type": "array",
      "description": "Custom metadata.",
      "items": {
        "type": "object",
        "description": "Custom metadata key-value entry.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Metadata unique identifier.",
            "example": 1
          },
          "key": {
            "type": "string",
            "description": "Metadata key.",
            "example": "string-value"
          },
          "value": {
            "type": "string",
            "description": "Metadata value.",
            "example": "string-value"
          }
        }
      },
      "example": [
        "string-value"
      ]
    }
  }
}