v1

latestSwagger 2.02026-07-13137761.0 MB
Product model

Update/create a product model

This endpoint allows you to update a given product model. Learn more about <a href="/documentation/update.html#update-behavior">Update behavior</a>. Note that if no product model exists for the given code, it creates it. In the Enterprise Edition PIM since the 2.3, permissions based on your user groups are applied to the product model you try to update. It may result in the creation of a draft if you only have edit rights through the product model's categories.

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

Path parameters

codestring required

Code of the resource

Request body

codestring required

Product model code

familystring

<a href='api-reference-paas.html#Family'>Family</a> code from which the product inherits its attributes and attributes requirements (since the 3.2)

family_variantstring required

Family variant code from which the product model inherits its attributes and variant attributes

parentstring

Code of the parent <a href='api-reference-paas.html#Productmodel'>product model</a>. This parent can be modified since the 2.3.

categoriesstring[]

Codes of the <a href='api-reference-paas.html#Category'>categories</a> in which the product model is categorized

valuesobject

Product model attributes values, see <a href='/concepts/products.html#focus-on-the-product-values'>Product values</a> section for more details

createdstring dateTime

Date of creation

updatedstring dateTime

Date of the last update

quality_scoresobject

Product model quality scores for each channel/locale combination (<strong>only available since the 7.0 version</strong> and when the "with_quality_scores" query parameter is set to "true")

Example request

{
  "code": "model-biker-jacket-leather",
  "family": "clothing",
  "family_variant": "clothing_material_size",
  "parent": "model-biker-jacket",
  "categories": [
    "summer_collection"
  ],
  "values": {
    "color": [
      {
        "locale": null,
        "scope": null,
        "data": "antique_white"
      }
    ],
    "material": [
      {
        "locale": null,
        "scope": null,
        "data": "leather"
      }
    ],
    "variation_name": [
      {
        "locale": "en_US",
        "scope": null,
        "data": "Biker jacket leather"
      }
    ],
    "name": [
      {
        "locale": "en_US",
        "scope": null,
        "data": "Biker jacket"
      }
    ],
    "collection": [
      {
        "locale": null,
        "scope": null,
        "data": [
          "summer_2017"
        ]
      }
    ],
    "description": [
      {
        "locale": "en_US",
        "scope": "ecommerce",
        "data": "Biker jacket"
      }
    ]
  },
  "associations": {
    "PACK": {
      "products": [
        "sunglass"
      ],
      "product_models": [],
      "groups": []
    }
  },
  "quantified_associations": {
    "PRODUCT_SET": {
      "products": [
        {
          "identifier": "top",
          "quantity": 2
        },
        {
          "identifier": "cap",
          "quantity": 1
        }
      ],
      "product_models": [
        {
          "code": "model-biker-jacket-leather",
          "quantity": 2
        }
      ]
    }
  },
  "quality_scores": [
    {
      "scope": "ecommerce",
      "locale": "en_US",
      "data": "A"
    },
    {
      "scope": "ecommerce",
      "locale": "fr_FR",
      "data": "B"
    },
    {
      "scope": "tablet",
      "locale": "en_US",
      "data": "D"
    },
    {
      "scope": "tablet",
      "locale": "fr_FR",
      "data": "E"
    }
  ],
  "created": "2017-10-02T15:03:55+02:00",
  "updated": "2017-10-02T15:03:55+02:00"
}

Response

Created