Configurator API: Include the Attribute Developer Name When Creating or Updating Attributes
When a constraint model is active, include the attribute developer name in Product Configurator API requests that create or update a product attribute.
When a constraint model is active, Product Configurator API requests that create or update a product attribute must include AttributeName in the payload. Set AttributeName to the attribute’s developer name. The constraint engine matches that value to the attribute name defined in the CML model, which is the CML variable name.
When you import a product attribute from Product Catalog Management (PCM) into CML, the variable name is the attribute’s developer name. For the engine to apply the value in the request, AttributeName must match that CML variable name. AttributeKey doesn’t replace AttributeName.
When the payload includes a matching AttributeName, the engine uses the submitted attribute value. When the payload omits AttributeName, the engine can’t match the input to a CML variable and applies the default attribute value defined in CML.
This addedNodes payload creates an order item attribute without AttributeName. The engine applies the CML default for that attribute instead of "true".
1{
2 "path": [
3 "801WI00001Q5fN0YAJ",
4 "ref_Assoc1Line",
5 "ref_Assoc1LineAttrAssoc"
6 ],
7 "addedObject": {
8 "id": "ref_Assoc1LineAttrAssoc",
9 "SalesTransactionItemAttrParent": "ref_Assoc1Line",
10 "ParentReference": "ref_Assoc1Line",
11 "AttributeKey": "0tjWI0000000I6cYAE",
12 "AttributeValue": "true",
13 "businessObjectType": "OrderItemAttribute"
14 }
15}
This payload includes AttributeName set to Associate, which matches the CML variable. The engine applies "true".
1{
2 "path": [
3 "801WI00001Q5fN0YAJ",
4 "ref_Assoc1RV",
5 "ref_Assoc1RVAssocAttr"
6 ],
7 "addedObject": {
8 "id": "ref_Assoc1RVAssocAttr",
9 "AttributeName": "Associate",
10 "SalesTransactionItemAttrParent": "ref_Assoc1RV",
11 "ParentReference": "ref_Assoc1RV",
12 "AttributeKey": "0tjWI0000000I6cYAE",
13 "AttributeValue": "true",
14 "businessObjectType": "OrderItemAttribute"
15 }
16}
For a picklist attribute, include AttributeName with the same developer-name match, plus AttributeValue and AttributePicklistValue.
1{
2 "path": [
3 "801WI00001Q5fN0YAJ",
4 "ref_Assoc1RV",
5 "ref_Assoc1RVLengthAttr"
6 ],
7 "addedObject": {
8 "id": "ref_Assoc1RVLengthAttr",
9 "AttributeName": "RV_Trailer",
10 "SalesTransactionItemAttrParent": "ref_Assoc1RV",
11 "ParentReference": "ref_Assoc1RV",
12 "AttributeKey": "0tjWI0000000I6bYAE",
13 "AttributeValue": "Upto 33 Ft and longer",
14 "AttributePicklistValue": "0v6WI0000000DuxYAE",
15 "businessObjectType": "OrderItemAttribute"
16 }
17}
Include AttributeName the same way in updatedNodes when you update an existing attribute. On a quote, use businessObjectType QuoteLineItemAttribute and the same AttributeName requirement.
For how the engine chooses a default when no matching payload value is present, see defaultValue Annotation.