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

Latest commit

 

History

History
89 lines (64 loc) · 2 KB

product-attributes.md

File metadata and controls

89 lines (64 loc) · 2 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 Attributes API

Table of Contents

List Product Attributes

GET /products/attributes

There are no parameters required for this endpoint.

curl "https://example-store.com/wp-json/wc/store/v1/products/attributes"

Example response:

[
	{
		"id": 1,
		"name": "Color",
		"taxonomy": "pa_color",
		"type": "select",
		"order": "menu_order",
		"has_archives": false
	},
	{
		"id": 2,
		"name": "Size",
		"taxonomy": "pa_size",
		"type": "select",
		"order": "menu_order",
		"has_archives": false
	}
]

Single Product Attribute

Get a single attribute taxonomy.

GET /products/attributes/:id
Attribute Type Required Description
id integer Yes The ID of the attribute to retrieve.
curl "https://example-store.com/wp-json/wc/store/v1/products/attributes/1"

Example response:

{
	"id": 1,
	"name": "Color",
	"taxonomy": "pa_color",
	"type": "select",
	"order": "menu_order",
	"has_archives": false
}

We're hiring! Come work with us!

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