Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Latest commit

 

History

History
53 lines (39 loc) · 1.78 KB

product-attribute-terms.md

File metadata and controls

53 lines (39 loc) · 1.78 KB

📣 Announcement: New documentation location

The documentation for WooCommerce Blocks has moved to the WooCommerce monorepo.

Please refer to the documentation in the new location as the files in this repository will no longer be updated and the repository will be archived.


Product Attribute Terms API

GET /products/attributes/:id/terms
GET /products/attributes/:id/terms?orderby=slug
Attribute Type Required Description
id integer Yes The ID of the attribute to retrieve terms for.
order string no Order ascending or descending. Allowed values: asc, desc
orderby string no Sort collection by object attribute. Allowed values: name, slug, count, menu_order.
curl "https://example-store.com/wp-json/wc/store/v1/products/attributes/1/terms"

Example response:

[
	{
		"id": 22,
		"name": "Blue",
		"slug": "blue",
		"count": 5
	},
	{
		"id": 48,
		"name": "Burgundy",
		"slug": "burgundy",
		"count": 1
	}
]

We're hiring! Come work with us!

🐞 Found a mistake, or have a suggestion? Leave feedback about this document here.