Skip to main content

Products API

The Products endpoint allows you to create, read, update, and delete products in your WooCommerce store.

The Product Object

Product Properties

integer
required
Unique identifier for the product. Read-only.
string
required
Product name.
string
Product slug. Auto-generated from name if not provided.
Product URL. Read-only.
string
The date the product was created, in ISO8601 format. Read-only.
string
The date the product was last modified, in ISO8601 format. Read-only.
string
default:"simple"
Product type. Options: simple, grouped, external, variable
string
default:"publish"
Product status. Options: draft, pending, private, publish
Featured product.
string
default:"visible"
Catalog visibility. Options: visible, catalog, search, hidden
string
Product description (HTML).
string
Product short description (HTML).
string
Unique product identifier (Stock Keeping Unit).
string
Current product price. Read-only.
string
Product regular price.
string
Product sale price.
boolean
Whether the product is on sale. Read-only.
string
default:"instock"
Stock status. Options: instock, outofstock, onbackorder
integer
Stock quantity. Only applicable if managing stock.
boolean
default:"false"
Enable stock management at product level.
array
List of product categories.
array
List of product images.

List All Products

Retrieve a list of all products in your store.

Query Parameters

integer
default:"1"
Current page of the collection.
integer
default:"10"
Maximum number of items to return (max 100).
Limit results to those matching a string.
string
Limit response to products published after a given ISO8601 date.
string
Limit response to products published before a given ISO8601 date.
string
default:"any"
Limit result set to products with specific status. Options: any, draft, pending, private, publish
string
Limit result set to products with specific type. Options: simple, grouped, external, variable
string
Limit result set to products with a specific SKU.
Limit result set to featured products.
string
Limit result set to products in specific category ID(s). Comma-separated list.
string
Limit result set to products with specific tag ID(s). Comma-separated list.
boolean
Limit result set to products on sale.
string
Limit result set to products based on minimum price.
string
Limit result set to products based on maximum price.
string
Limit result set to products with specified stock status. Options: instock, outofstock, onbackorder
string
default:"date"
Sort collection by attribute. Options: date, id, title, slug, price, popularity, rating
string
default:"desc"
Order sort direction. Options: asc, desc

Example Response

Retrieve a Product

Get details of a single product by ID.

Create a Product

Create a new product in your store.

Required Fields

string
required
Product name

Optional Fields

string
default:"simple"
Product type: simple, grouped, external, variable
string
Product regular price
string
Product sale price
string
Product description (supports HTML)
string
Product short description (supports HTML)
string
Unique SKU (Stock Keeping Unit)
boolean
default:"false"
Enable stock management
integer
Stock quantity (requires manage_stock to be true)
string
default:"instock"
Stock status: instock, outofstock, onbackorder
array
List of category IDs
array
List of product images

Update a Product

Update an existing product.

Delete a Product

Delete a product permanently or move it to trash.

Parameters

boolean
default:"false"
Set to true to permanently delete the product. Otherwise, it will be moved to trash.

Batch Update Products

Create, update, and delete multiple products in a single request.

Product Variations

For variable products, you can manage variations through a sub-endpoint.

List Product Variations

Create a Variation

Common Use Cases

Update Stock Quantity

Set Product on Sale

Add Product to Category

Search Products by SKU

Filter by Price Range

Error Handling

Invalid Product ID

Missing Required Field

Duplicate SKU

Next Steps

Orders API

Manage customer orders

Customers API

Work with customer data