Products API
List Products
GET /ec/v1/products
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | int | 1 | Page number |
per_page | int | 12 | Items per page |
search | string | — | Search term |
category | int | — | Category ID filter |
brand_ids | string | — | Comma-separated brand IDs |
orderby | string | date | Sort field: date, price, title, popularity |
order | string | desc | Sort direction: asc, desc |
min_price | float | — | Minimum price filter |
max_price | float | — | Maximum price filter |
Response
{
"success": true,
"data": {
"items": [
{
"id": 1,
"title": "Product Name",
"slug": "product-name",
"price": "29.99",
"sale_price": null,
"sku": "PROD-001",
"stock_status": "in_stock",
"stock_quantity": 50,
"featured_image": "https://...",
"categories": [{ "id": 1, "name": "Category" }],
"created_at": "2026-01-15T10:30:00Z"
}
],
"total": 150,
"pages": 13
}
}
Get Single Product
GET /ec/v1/products/{id}
Returns full product details including variants, gallery images, and description.
Create Product
POST /ec/v1/products
Requires admin authentication.
Body
{
"title": "New Product",
"description": "Full description here",
"short_description": "Brief summary",
"price": "39.99",
"sale_price": "29.99",
"sku": "NEW-001",
"stock_quantity": 100,
"category_ids": [1, 3],
"featured_image_id": 42
}
Update Product
PUT /ec/v1/products/{id}
Partial updates supported — only send fields that changed.
Delete Product
DELETE /ec/v1/products/{id}
Requires admin authentication. Returns 204 on success.
Hooks
These filters are applied during API responses:
wpec_api_product_response— Transform individual product responsewpec_api_products_response— Transform product list responsewpec_product_query_args— Modify the underlying database query