Create a product category
POST/categories
Creates a category as the acting user. Omit parent_id for a top-level category.
- Categories can be nested up to 5 levels, and a category that already has products cannot get a child.
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_FAILED | The category would sit deeper than 5 levels. |
| 404 | NOT_FOUND | Unknown parent. |
| 409 | DATA_CONFLICT | The name is already used under the same parent, or the parent already has products (the message tells which). |
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 422
The new category
Error envelope
Error envelope
Error envelope
Error envelope
DATA_CONFLICT for both cases: the name is already used under the same parent, or the parent already has products. Only the message differs.
Error envelope