younifyd
Menu

Patch Category By Code

Create or update a category

PATCH/api/rest/v1/categories/{code}

Use it in a workflow

  1. Add a step and choose the Akeneo connector.
  2. Pick the Patch Category By Code action (under Category).
  3. Fill in the fields below, then reference the result from later steps as {{patchCategoryByCode.response.data}}.

Request

Path parameters

codestringrequired

This path parameter is used to specify the unique identifier of the entity you want to retrieve or manipulate. It is essential for identifying the specific entity in the API requests. Ensure that the code is correctly formatted and corresponds to an existing entity in the system.

Request body

Enter the body as JSON in the step's Body field.

codestring

Category code

parentstring | null

Category code of the parent's category

updatedstring (date-time)

Date of the last update

positioninteger

Position of the category in its level, start from 1 (only available when query parameter `with_position` is set to `true`)

labelsobject

Default {}

channel_requirementsarray<string>

List of Channel codes on which the category is required for products completeness. Only category trees can be required, not child categories.

Default []

valuesoneOf

Attribute values

Default []

validationsobject

Category validations

Default {}

max_categories_per_productinteger

Set maximum number of categories per product

only_leavesboolean

Restrict categorization to the lowest level

is_mandatoryboolean

Set category as mandatory for every product

json
{
  "code": "winter_collection",
  "parent": "root_category",
  "updated": "2021-05-21T11:32:00+02:00",
  "position": 1,
  "labels": {
    "en_US": "Winter collection",
    "fr_FR": "Collection hiver",
    "de_DE": "Winter-Kollektion"
  },
  "channel_requirements": [
    "ecommerce",
    "mobile"
  ],
  "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"
    }
  ],
  "validations": {
    "max_categories_per_product": 5,
    "only_leaves": true,
    "is_mandatory": false
  }
}

Response

Returns 201 with a any. Read it in later steps with {{patchCategoryByCode.response.data.<field>}}.

Need more? See the Akeneo guide for connection setup and behaviour shared by every action.

Was this page helpful?