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

Parameters: list_products
NameTypeDescription
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
curl https://cotlet.dev/api/v1/woocommerce/products \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("woocommerce", "list_products")
Node.js
const result = await cotlet.call('woocommerce', 'list_products');
CLI
cotlet call woocommerce list_products

Example response

JSON

{
  "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
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.