younifyd
Menu

Patch Product Model By Code

Update/create a product model

PATCH/api/rest/v1/product-models/{code}

Use it in a workflow

  1. Add a step and choose the Akeneo connector.
  2. Pick the Patch Product Model By Code action (under Product model).
  3. Fill in the fields below, then reference the result from later steps as {{patchProductModelByCode.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.

Query parameters

create_missing_optionsstring

When present in the query string (regardless of value), automatically creates missing attribute options during product/product model creation or update. This only works for simple select and multi select attributes that have the `enable_option_creation_during_import` property set to `true` (configurable via the Attribute API).

Request body

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

codestring

Product model code. Required for POST (create) operations. Optional for PATCH (update) operations as it can be inferred from the URL.

familystring

[Family](https://api.akeneo.com/api-reference.html#Family) code from which the product model inherits its attributes and attributes requirements. In the case of variant product, the given family should be the same as the product model family.

family_variantstring

Family variant code from which the product model inherits its attributes and variant attributes. Required for root product models (without parent). Optional for sub-product models (with parent), as it can be inferred from the parent.

parentstring | null

Code of the parent [product model](https://api.akeneo.com/api-reference.html#Productmodel)

Default null

categoriesarray<string>

Codes of the [categories](https://api.akeneo.com/api-reference.html#Category) in which the product model is categorized

Default []

add_categoriesarray<string>

Codes of the [categories](https://api.akeneo.com/api-reference.html#Category) to add to the product model. Existing categories will be preserved.

Default []

remove_categoriesarray<string>

Codes of the [categories](https://api.akeneo.com/api-reference.html#Category) to remove from the product model. Other categories will be preserved.

Default []

valuesobject

Product model attributes values. Each key is an attribute code, and the value is an array of value objects for that attribute. See [documentation](https://api.akeneo.com/concepts/products.html#focus-on-the-product-values) for details.

associationsobject

Several associations related to groups, product models and/or other products, grouped by association types

quantified_associationsobject

Several quantified associations related to products and/or product models, grouped by quantified association types

createdstring (dateTime)

Date of creation

updatedstring (dateTime)

Date of the last update

metadataobject

More information around the product model

workflow_statusstring

Status of the product model regarding the user permissions

One ofread_onlydraft_in_progressproposal_waiting_for_approvalworking_copy

quality_scoresarray<object>

Product quality scores for each channel/locale combination (only available when the `with_quality_scores` query parameter is set to `true`).

scopestring

Channel code for which the quality score is calculated

localestring

Locale code for which the quality score is calculated

datastring

Quality score value for the given channel/locale combination

One ofABCDE

workflow_execution_statusesarray<object>

Workflow execution statuses of the product (only available when the `with_workflow_execution_statuses` query parameter is set to `true`).

uuidstring

Workflow execution UUID

statusstring

Status of the workflow execution

One ofin_progresscompleted

started_atstring (date-time)

Date and time when the workflow execution was started

completed_atstring | null

Date and time when the workflow execution was completed, null if still in progress

workflowobject3 fields

Workflow associated with the workflow execution

tasksarray<object>4 fields

Tasks associated with the workflow execution

json
{
  "code": "amarisshoe",
  "family": "shoes",
  "family_variant": "shoes_Variant",
  "parent": "clothes",
  "categories": [
    "clothing",
    "shoes"
  ],
  "add_categories": [
    "clothing",
    "shoes"
  ],
  "remove_categories": [
    "shirts",
    "trousers"
  ],
  "values": {
    "name": [
      {
        "locale": "en_US",
        "data": "Biker jacket"
      }
    ],
    "description": [
      {
        "locale": "en_US",
        "scope": "ecommerce",
        "data": "Biker jacket for women"
      }
    ]
  },
  "associations": {
    "X_SELL": {
      "groups": [],
      "products": [
        "product_1",
        "product_2"
      ],
      "product_models": [
        "product_model_1"
      ]
    },
    "UPSELL": {
      "groups": [
        "group_1"
      ],
      "products": [],
      "product_models": []
    }
  },
  "quantified_associations": {
    "PACK": {
      "products": [
        {
          "identifier": "product_1",
          "quantity": 2
        },
        {
          "identifier": "product_2",
          "quantity": 3
        }
      ],
      "product_models": [
        {
          "identifier": "product_model_1",
          "quantity": 1
        }
      ]
    }
  },
  "created": "2025-01-01T12:00:00Z",
  "updated": "2025-01-01T12:00:00Z"
}

Response

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

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