Creating a new subcategory

POST {{api-url}}/category/{{tenant}}/categories?publish=true

Creates a new category.


Required scopes

  • category.category_create* category.category_publish Note: category.category_publish only required if you want to publish the category when creating it.

Request Params

KeyDatatypeRequiredDescription
publishbooleanIf set to true category may be published when updated, otherwise may be unpublished. It must match value of 'published' field of the request body.
Possible values:
  • true
  • false Note: To publish a category you need to have category.category_publish scope. Note: To unpublish a category you need to have category.category_unpublish scope. |

Request Body

{"parentId"=>"{{parentCategoryId}}", "localizedName"=>{"en"=>"Non-alcoholic drinks", "de"=>"Alkoholfreie Getränke"}, "localizedDescription"=>{"en"=>"Non-alcoholic drinks", "de"=>"Alkoholfreie Getränke"}, "localizedSlug"=>{"en"=>"NAD", "de"=>"AG"}, "ecn"=>["Acaaa1a23", "1z2aaaZA"], "validity"=>{"from"=>"2022-01-05T12:44:51.871Z", "to"=>"2025-12-05T23:59:59.000Z"}, "position"=>2, "published"=>true}

HEADERS

KeyDatatypeRequiredDescription
X-Versionstring(Required) To use this endpoint you have to add X-Version header with proper value to your request.

Note: The header value has to match following regular expression: ^v[1-9][0-9]?$ | | Accept | string | | | | Content-Language | string | | |

RESPONSES

status: Created

{"id":"084bcaf6-66b8-4ddd-9489-65c5f6449e94"}