Skip to main content

Catalog

Routes​

MethodRoutePermissionSince
GET/productsSigned in1.4.0
GET/products/{id}Signed in1.4.0
GET/products/{id}/availabilityPublic1.8.0
PUT, PATCH/products/{id}/availabilityManagement or store1.4.0
GET/catalogSigned in1.4.0
GET/product-categoriesSigned in1.4.0
GET/product-categories/{id}Signed in1.4.0
GET/product-categories/{id}/productsSigned in1.4.0

Product lists require a signed-in user, even though those products are visible in the store. To show the catalog without a session, use the WooCommerce Store API.

Product object​

{
"id": 120,
"name": "Smash clásica",
"price": "12000",
"price_html": "<span class=\"amount\">$ 12.000</span>",
"image_url": "https://tienda.example.test/wp-content/uploads/smash.jpg",
"currency_symbol": "$",
"is_enabled": true,
"extra_option_categories": [18],
"extra_options": [
{
"id": 18, "title": "Adiciones", "type": "checkbox-limitedchoice",
"minimum_options": 0, "maximum_options": 2, "required": false, "hide_prices": false,
"options": [ { "id": 91, "name": "Queso extra", "price": 3000, "sku": "", "prechecked": false } ]
}
]
}

Variable products include variations[] (each variation with its price, attributes and its own extras) and attributes[].

List and read products​

GET /products

ParameterNotes
page, per_pageStandard pagination.
searchSearch text.
categoryProduct category ID.

Returns only published products. GET /products/{id} responds 404 notiwoo_not_found if the product does not exist or is not published.

Availability​

GET /products/{id}/availability is public and responds { product_id, available, reasons[] }. Possible reasons are not_found, not_published, manually_disabled and out_of_stock.

PUT /products/{id}/availability with { "enabled": false } disables a product while keeping it published, like the app's switch. Responds { id, enabled }.

curl -X PUT https://tienda.example.test/wp-json/notiwoo/v1/products/120/availability \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"enabled": false}'

Full catalog​

GET /catalog returns every category that has products, each with its published products: data[] = { cat_id, name, products[] }. It is not paginated, so on large catalogs the response can be heavy. Cache it.

Product categories​

  • GET /product-categories?hide_empty=true returns { id, name, slug, description, count, parent }, sorted by menu order.
  • GET /product-categories/{id}/products returns the category's products, paginated. meta.category identifies the category.

Extra filters in the WooCommerce API​

Since 1.26.0, Notiwoo adds these parameters to GET /wp-json/wc/v3/products:

ParameterValues
notiwoo_imagewith or without: products with or without an image.
notiwoo_extraswith or without: products with or without extras.
notiwoo_extra_categoryID of an extra category.

These are the same filters used in the app catalog.