Skip to main content

Products

The Products resource provides full CRUD for WooCommerce products.

Endpoints

MethodPathDescription
GET/woo/productsList products
GET/woo/products/{id}Get product
POST/woo/productsCreate product
PUT / PATCH/woo/products/{id}Update product
DELETE/woo/products/{id}Delete product

List query parameters

ParameterTypeDefaultDescription
fieldsstringdefault setComma-separated field names
statusstring|arrayFilter by status (comma-separated)
typestringFilter by product type
skustringExact SKU match
searchstringText search
stock_statusstringinstock, outofstock, onbackorder
sortstring-date_createdSort field, prefix - for DESC
pageint1Page number
per_pageint20Items per page (max 100)

Allowed sort fields: date_created, date_modified, id, title, price

Available fields

List defaults: id, name, slug, status, type, sku, price, stock_status, date_created, date_modified

All fields: id, name, slug, status, type, sku, price, regular_price, sale_price, date_created, date_modified, catalog_visibility, description, short_description, stock_status, stock_quantity, manage_stock, virtual, downloadable, meta_data

Create / Update payload

{
"name": "Premium Widget",
"status": "publish",
"type": "simple",
"sku": "WDG-001",
"regular_price": "29.99",
"sale_price": "24.99",
"description": "Full product description.",
"short_description": "A premium widget.",
"stock_status": "instock",
"stock_quantity": 50,
"manage_stock": true,
"virtual": false,
"downloadable": false,
"catalog_visibility": "visible",
"meta_data": [
{ "key": "brand", "value": "WidgetCo" }
]
}

Notes

  • type is create-only. It cannot be changed after creation. Defaults to simple when omitted.
  • Boolean fields (manage_stock, virtual, downloadable) accept booleans, integers (0/1), or strings ("true", "false", "yes", "no").
  • stock_quantity accepts an integer or null.

v0.3.0 changes

  • deleteMode ('force' default or 'trash') on the registrar controls whether DELETE permanently removes or trashes the product.
  • Protected meta keys (_...) are not returned and not writable by default.