v1

latestSwagger 2.02026-07-13137761.0 MB
Product model

Update/create several product models

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

patch/api/rest/v1/product-models

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

OK

lineinteger

Line number

identifierstring

Resource identifier, only filled when the resource is a product

codestring

Resource code, only filled when the resource is not a product

status_codeinteger

HTTP status code, see <a href="/documentation/responses.html#client-errors">Client errors</a> to understand the meaning of each code

messagestring

Message explaining the error