Product data modeling guide

The commercetools platform provides a customizable product and category data model. This guide provides high-level guidance on the commercetools product data model and how to map your product catalog to the data model.

We recommend reading through the guide completely before deciding on a strategy. It’s important to understand all the different ways to model product information and how they interact before you begin.

Terminology

For data modeling purposes, the commercetools product data model contains the following elements:

  • Product Type: A set of attributes which acts as a template for a group of similar products. Product Types have Product Attributes, which define characteristics of a group of products.
  • Product Attributes: A unique characteristic or piece of information about a Product. Product Attributes are defined in Product Types.
  • Product: An abstract sellable good with a set of Product Attributes defined by a Product Type. Products themselves are not sellable. Instead, they act as a parent structure for Product Variants. Each Product must have at least one Product Variant, which is called the Master Variant.
  • Product Variant: A concrete sellable good. Product Variants are generally mapped to specific SKUs. Inventory is modeled per variant.
  • Category: A grouping of products. You can create categories to group product characteristics, marketing concerns or search concerns.

The commercetools product information data model

To begin, let’s look at how the different elements of the commercetools data model interact. This isn’t the complete commercetools data model, only the objects that let us model product information.

product data model

At a high level, entities (objects or resources in the API) relate to each other using containment and assignment. Product Types contain Product Attribute Definitions. Attributes are passed on to Products and Product Variants. Products and all their Product Variants are assigned to Categories.

product type with attributes

A Product Type has zero or more Product Attribute Definitions. Products, Categories, and Product Types can exist in commercetools independent of each other, but Product Attributes are defined as part of a Product Type.

product type to product relationship

An individual Product has exactly one Product Type. Multiple Products can use the same Product Type.

product type to product relationship

A Product can populate all Product Attributes defined in its Product Type. If the Product Attribute is not a required field, it can remain undefined on the Product.

product to category relationship

A Product be assigned any number of Categories, and a Category can have any number of products assigned to it.

product to product variant relationship

A Product has a minimum of one Product Variant, called the Master Variant. Optionally it can have any number of additional Product Variants.

category to product relationship