v1

latestSwagger 2.02026-07-13137761.0 MB
Category

Update/create several categories

This endpoint allows you to update several categories at once.

patch/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

OK

lineinteger

Line number

identifierstring

Resource identifier, only filled when the resource is a product

codestring

Resource code, only filled when the resource is not a product

status_codeinteger

HTTP status code, see <a href="/documentation/responses.html#client-errors">Client errors</a> to understand the meaning of each code

messagestring

Message explaining the error