Understand how performance and compliance data maps to OpenAI fields.
Performance Signals
If using
popularity_score or return_rate, you must create Variant-level Attributes for these fields. The Attribute types must be AttributeNumberType.The values of these Attributes can be calculated based on your business logic, such as Review and Order data.
| OpenAI Field | Related commercetools field | Required | Mapping Logic |
|---|---|---|---|
popularity_score | variant.attributes["popularity_score"] | Optional | You can calculate this based on sales data, or use Product.reviewRatingStatistics.averageRating. For example, 4.7 |
return_rate | variant.attributes["return_rate"] | Optional | You can calculate this based on return information of specific products. The result should be a percentage. For example: 2%. |
Compliance
If using
warning/warning_url or age_restriction, you must create Variant-level Attributes for these fields. The warning/warningUrl field must be an AttributeTextType, and the ageRestriction field must be an AttributeNumberType.| OpenAI Field | Related commercetools field | Required | Mapping Logic |
|---|---|---|---|
warning / warning_url | variant.attributes.warningvariant.attributes.warningUrl | Optional | Include any product warnings or other necessary information. For example: Contains lithium battery or CA Prop 65 warning. |
age_restriction | variant.attributes.ageRestriction | Optional | The minimum age required to purchase the product. For example: 21. |