List products
Products with price, sale price, stock and status, filtered by search, category, status or SKU.
GET https://cotlet.dev/api/v1/woocommerce/products
read
Lists products with their regular and sale price, stock quantity and publication status. Filter by a search term, category, status or SKU, or show only products on sale. Use it to find the product_id for update_product and to check stock after a refund or a sale. Variations are returned on the product that owns them.
Parameters
| Name | Type | Description |
|---|---|---|
| search string | string | Text in the product name or description. |
| sku string | string | Exact SKU. |
| category integer | integer | Product category ID. |
| status enum | enum | any, draft, pending, private or publish. Default: any. |
| on_sale boolean | boolean | true returns only products on sale. |
| limit integer | integer | Results per page. Default: 10. |
| page integer | integer | Page number, starting at 1. Default: 1. |
Request
curl https://cotlet.dev/api/v1/woocommerce/products \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("woocommerce", "list_products") const result = await cotlet.call('woocommerce', 'list_products'); cotlet call woocommerce list_products Example response
{
"products": [
{
"product_id": 311,
"name": "Linen tote bag",
"sku": "TOTE-LIN-01",
"status": "publish",
"regular_price": "14.00",
"sale_price": "",
"on_sale": false,
"manage_stock": true,
"stock_quantity": 40
}
],
"total": 1,
"total_pages": 1
}