Skip to main content

POST /v1/categories

Scope

write_items

Request parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringrequiredIdempotency key (required). A UUID v4 is recommended. Resending the same key replays the original result, and the response carries Idempotent-Replay: true. Sending a different body with the same key returns 422, so always retry with the identical request.
namebodystringrequiredCategory name, 1-40 characters.
parent_idbodystringoptionalThe parent category. Omit it to create a top-level category. Categories nest up to two levels.
statusbodyenum(activeinactive)optional

Response example

{
"data": {
"id": "1",
"parent_id": "string",
"name": "string",
"status": "active",
"sort": 0
}
}

Description

Create a category. Its sort order is assigned automatically at the end of the same level. (write_items)

Error response example

{
"error": {
"code": "insufficient_scope",
"message": "requires scope 'write_items'",
"request_id": "req_01H..."
}
}

Possible errors: 400 / 401 / 403 / 422 / 503