Skip to main content
GET
/
api
/
v3
/
store
/
categories
/
{id}
Spree SDK
import { createClient } from '@spree/sdk'

const client = createClient({
  baseUrl: 'https://your-store.com',
  publishableKey: '<api-key>',
})

const category = await client.categories.get('categories/clothing/shirts', {
  expand: 'children',
})
{
  "id": "ctg_gbHJdmfrXB",
  "name": "taxon_10",
  "permalink": "taxonomy-7/taxon-10",
  "position": 0,
  "depth": 1,
  "meta_title": null,
  "meta_description": null,
  "meta_keywords": null,
  "children_count": 1,
  "parent_id": "ctg_UkLWZg9DAJ",
  "description": "",
  "description_html": "",
  "image_url": null,
  "square_image_url": null,
  "is_root": false,
  "is_child": true,
  "is_leaf": false
}

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Headers

x-spree-api-key
string
required

Path Parameters

id
string
required

Category permalink (e.g., clothing/shirts) or prefix ID (e.g., ctg_abc123)

Query Parameters

expand
string

Expand associations (children, parent, ancestors, custom_fields)

fields
string

Comma-separated list of fields to include (e.g., name,slug,price). id is always included.

Response

category found by prefix ID

id
string
required
name
string
required
position
number
required
depth
number
required
meta_title
string | null
required
meta_description
string | null
required
meta_keywords
string | null
required
children_count
number
required
parent_id
string | null
required
description
string
required
description_html
string
required
image_url
string | null
required
square_image_url
string | null
required
is_root
boolean
required
is_child
boolean
required
is_leaf
boolean
required
parent
any
children
array
ancestors
array
custom_fields
object[]