Product attributes
ATUM extends the official WC's product attributes endpoint (/wp-json/wc/v3/products/attributes) with the possibility of getting the terms of every attribute within the same request.
You can identify the ATUM data with the corresponding labels.
This page only describes the ATUM additions. For the rest of properties and operations (create, retrieve, update, delete and batch), please check the WooCommerce REST API docs.
Product attribute properties
This field is added to every product attribute returned by the endpoint, along with the WC's properties.
| Attribute | Type | Description |
|---|---|---|
terms | array | List of terms linked to the attribute (including the terms that aren't assigned to any product). It's only filled when the with_terms param is set to yes, otherwise it returns null. See Product attribute - Terms properties ATUM read-only |
Product attribute - Terms properties
ATUM| Attribute | Type | Description |
|---|---|---|
id | integer | Term ID. |
name | string | Term name. |
slug | string | Term slug. |
List all product attributes
This API helps you to view all the product attributes. Add the with_terms=yes param to get their terms too.
HTTP request
/wp-json/wc/v3/products/attributescurl https://example.com/wp-json/wc/v3/products/attributes?with_terms=yes \
-u consumer_key:consumer_secret[
{
"id": 6,
"name": "Color",
"slug": "pa_color",
"type": "select",
"order_by": "menu_order",
"has_archives": false,
"terms": [
{
"id": 22,
"name": "Black",
"slug": "black"
},
{
"id": 23,
"name": "Blue",
"slug": "blue"
},
{
"id": 24,
"name": "Green",
"slug": "green"
}
],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/attributes/6"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/attributes"
}
]
}
},
{
"id": 7,
"name": "Size",
"slug": "pa_size",
"type": "select",
"order_by": "menu_order",
"has_archives": false,
"terms": [
{
"id": 26,
"name": "S",
"slug": "s"
},
{
"id": 27,
"name": "M",
"slug": "m"
}
],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/attributes/7"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/attributes"
}
]
}
}
]Available parameters
| Parameter | Type | Description |
|---|---|---|
with_terms | string | Set it to yes to include the terms of every attribute in the terms field. ATUM |
The with_terms param works the same way when retrieving a single attribute (GET /wp-json/wc/v3/products/attributes/<id>). An attribute without terms returns null in the terms field.