Understand how item data maps to OpenAI fields.
All related fields are present within the ProductVariant type.
All of these fields, except
product_category, require Variant-level Attributes.| OpenAI Field | Related commercetools field | Required | Mapping Logic |
|---|---|---|---|
condition | attributes.condition | Required, if not new | This Attribute must be an enum type which accepts new, refurbished, or used. If this Attribute does not exist, the value defaults to new. |
product_category | Use Reference Expansion on productData.categories[0] and join productData.categories[0].obj.ancestors.obj.name[<locale>] | Required | Select the deepest (most specific) Category assigned to the product. Recursively traverse the selected Category's parent path using the Category list. Join the localized names with >. For example, [Root Category] > [Parent Category] > [Child Category] becomes Apparel & Accessories > Shoes > Running Shoes. |
brand | attributes.brand | Required | This Attribute must be a string value that does not exceed 70 characters. |
material | attributes.material | Required | Contains important information for advanced product filtering. For example: vegan leather bags or 100% cotton shirts. If this Attribute is a Set, you must join the values with and or a , . The total length of the string must not exceed 100 characters. |
dimensions | attributes.length x attributes.width x attributes.height | Optional | Used for filtering products based on size (for example, Find a backpack that fits under an airplane seat). These Attributes must be numbers. Combine the length, width, and height numerical Attribute values using x as a separator, and then append the unit. For example, 45x30x20 cm. |
length | attributes.length | Optional | This Attribute must be a number with the unit (cm or in) appended. For example: 45 cm. The unit must match the units for width and height if they are defined. |
width | attributes.width | Optional | This Attribute must be a number with the unit (cm or in) appended. For example: 30 cm. Only include if you are providing the individual length and height fields as well. Must include the unit. |
height | attributes.height | Optional | This Attribute must be a number with the unit (cm or in) appended. For example: 20 cm. Only include if also providing length and width. Essential for shipping and fit comparisons. |
weight | attributes.weight | Required | Used for filtering and to apply shipping costs. Extract the numerical weight value and concatenate it with the unit code. For example: 1.2 kg. |
age_group | attributes.ageGroup | Optional | This Attribute must be an enum type which accepts newborn, infant, toddler, kids, or adult. If this Attribute does not exist, the value defaults to adult. |