Skip to main content
POST
Spree Admin SDK

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Bearer token for admin authentication

Body

application/json
name
string
required
Example:

"Shirts"

external_references
object

Identities the record has in external systems, keyed by system: the same { system: external_id } map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of { system, external_id } entries is accepted too.

parent_id
string | null

The parent category. Omitted or null, a new category goes to the top level and an existing one keeps its parent: moving one to the top level is the reposition endpoint.

Example:

"ctg_abc123"

description
string

Rich text HTML. Reads come back as this (plain text) plus description_html.

meta_title
string
meta_description
string
meta_keywords
string
image_signed_id
string | null

A signed_id from files.upload() for the landscape image, or null to remove it.

square_image_signed_id
string | null

A signed_id from files.upload() for the square image, or null to remove it.

custom_fields
object[]

Custom field values, each validated against its definition.

Response

category created

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
external_references
object
required
metadata
object
required
pretty_name
string
required
lft
number
required
rgt
number
required
products_count
number
required
created_at
string
required
updated_at
string
required
parent
any
children
array
ancestors
array
custom_fields
object[]
translations
object