younifyd
Menu

Post Product Model

Create a new product model

POST/api/rest/v1/product-models

Use it in a workflow

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

Request

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.

codestringrequired

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 []

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

json
{
  "code": "amarisshoe",
  "family": "shoes",
  "family_variant": "shoes_Variant",
  "parent": "clothes",
  "categories": [
    "clothing",
    "shoes"
  ],
  "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
        }
      ]
    }
  }
}

Response

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

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