v1

latestSwagger 2.02026-07-13137761.0 MB
Category

Create a new category

This endpoint allows you to create a new category.

post/api/rest/v1/categories

Request body

codestring required

Category code

parentstring

Category code of the parent's category

updatedstring dateTime

Date of the last update

positioninteger

Position of the category in its level, start from 1 (only available since the 7.0 version and when query parameter "with_position" is set to "true")

channel_requirementsstring[]

List of <a href='api-reference-paas.html#Channel'>Channel</a> codes on which the category is required for products completeness. Only category trees can be required, not child categories.

Example request

{
  "code": "winter_collection",
  "parent": null,
  "labels": {
    "en_US": "Winter collection",
    "fr_FR": "Collection hiver"
  },
  "values": [
    {
      "data": "<p>Winter collection description</p>",
      "channel": "ecommerce",
      "locale": "en_US",
      "attribute_code": "a_text_area_attribute"
    },
    {
      "data": false,
      "channel": "ecommerce",
      "locale": null,
      "attribute_code": "a_boolean_attribute"
    },
    {
      "data": null,
      "channel": null,
      "locale": null,
      "attribute_code": "an_image_attribute"
    }
  ],
  "validations": {
    "max_categories_per_product": 42,
    "only_leaves": false,
    "is_mandatory": true
  },
  "channel_requirements": [
    "ecommerce",
    "mobile"
  ]
}

Response

Created