Skip to main content
GET
/
products
/
categories
Get product categories
curl --request GET \
  --url {protocol}://{host}/wp-json/cocart/v1/products/categories
[
  {
    "id": 123,
    "name": "<string>",
    "slug": "<string>",
    "parent": 123,
    "description": "<string>",
    "display": "<string>",
    "image": {
      "id": 123,
      "src": "<string>",
      "name": "<string>",
      "alt": "<string>"
    },
    "menu_order": 123,
    "count": 123,
    "links": {
      "self": [
        {
          "href": "<string>"
        }
      ],
      "collection": [
        {
          "href": "<string>"
        }
      ],
      "up": [
        {
          "href": "<string>"
        }
      ]
    }
  }
]

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
hide_empty
boolean
default:false

Whether to hide resources not assigned to any products.

parent
integer

Limit result set to resources assigned to a specific parent.

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 categories.

id
integer

Unique identifier for the category.

name
string

Category name.

slug
string

Category slug.

parent
integer

Parent category ID.

description
string

Category description.

display
string

Category display type.

image
object
menu_order
integer

Menu order.

count
integer

Number of products in the category.

I