Skip to main content
GET
/
products
/
attributes
/
{attribute_id}
/
terms
Get product attribute terms
curl --request GET \
  --url {protocol}://{host}/wp-json/cocart/v1/products/attributes/{attribute_id}/terms
[
  {
    "id": 123,
    "name": "<string>",
    "slug": "<string>",
    "description": "<string>",
    "count": 123,
    "links": {
      "self": [
        {
          "href": "<string>"
        }
      ],
      "collection": [
        {
          "href": "<string>"
        }
      ],
      "up": [
        {
          "href": "<string>"
        }
      ]
    }
  }
]

Path Parameters

attribute_id
integer
required

Unique identifier for the attribute of the terms.

Query Parameters

context
enum<string>
default:view

Scope under which the request is made; determines fields present in response.

Available options:
view,
embed
page
integer
default:1

Current page of the collection.

per_page
integer
default:10

Maximum number of items to be returned in result set.

Required range: x <= 100

Limit results to those matching a string.

exclude
integer[]

Ensure result set excludes specific IDs.

include
integer[]

Limit result set to specific IDs.

offset
integer

Offset the result set by a specific number of items.

order
enum<string>
default:asc

Order sort attribute ascending or descending.

Available options:
asc,
desc
orderby
enum<string>
default:name

Sort collection by object attribute.

Available options:
id,
include,
name,
slug,
term_group,
description,
count,
menu_order
hide_empty
boolean
default:false

Whether to hide resources not assigned to any products.

product
integer

Limit result set to resources assigned to a specific product.

slug
string

Limit result set to resources with a specific slug.

Response

List of product attribute terms.

id
integer

Unique identifier for the attribute term.

name
string

Attribute term name.

slug
string

Attribute term slug.

description
string

Attribute term description.

count
integer

Number of products with the attribute term.

I