younifyd
Menu

Post Category

Create a new category

POST/api/rest/v1/categories

Use it in a workflow

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

Request

Request body

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

codestringrequired

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 {{postCategory.response.data.<field>}}.

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