Back to Woocommerce

Product Attribute Terms API

docs/apis/store-api/resources-endpoints/product-attribute-terms.md

10.8.0-dev1.1 KB
Original Source

Product Attribute Terms API

http
GET /products/attributes/:id/terms
GET /products/attributes/:id/terms?orderby=slug
AttributeTypeRequiredDescription
idintegerYesThe ID of the attribute to retrieve terms for.
orderstringnoOrder ascending or descending. Allowed values: asc, desc
orderbystringnoSort collection by object attribute. Allowed values: id, name, name_num, slug, count, menu_order.
sh
curl "https://example-store.com/wp-json/wc/store/v1/products/attributes/1/terms"

Example response:

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