Menu
Create Variation Attribute
Create a variation attribute.
PUT
/organizations/{organizationId}/products/{productId}/variation-attributes/{id}Use it in a workflow
- Add a step and choose the Salesforce Commerce Cloud connector.
- Pick the Create Variation Attribute action (under Products (Data API)).
- Fill in the fields below, then reference the result from later steps as
{{createVariationAttribute.response.data}}.
Request
Path parameters
Request body
Enter the body as JSON in the step's Body field.
{
"attributeDefinitionId": "color",
"attributeDefinitionName": {
"en_US": "Color"
},
"defaultValue": "black",
"id": "color",
"name": {
"en_US": "Color"
},
"shared": false,
"slicing": true,
"values": [
{
"value": "red",
"description": {
"en_US": "Red"
},
"image": {
"path": "/images/apple-ipod-classic.jpg",
"absUrl": "https://www.example-image.com/images/apple-ipod-classic.jpg",
"alt": {
"en_US": "iPod"
},
"disBaseUrl": "https://www.dis-base-url/images/apple-ipod-clasic.jpg",
"title": {
"en_US": "iPod"
}
},
"imageSwatch": {
"path": "/images/apple-ipod-classic.jpg",
"absUrl": "https://www.example-image.com/images/apple-ipod-classic.jpg",
"alt": {
"en_US": "iPod"
},
"disBaseUrl": "https://www.dis-base-url/images/apple-ipod-clasic.jpg",
"title": {
"en_US": "iPod"
}
},
"name": {
"color": "Red"
},
"orderable": true,
"position": 2
}
],
"variationAttributeType": "string"
}
Response
Returns 200 with an object. Read it in later steps with {{createVariationAttribute.response.data.<field>}}.
{
"attributeDefinitionId": "color",
"attributeDefinitionName": {
"en_US": "Color"
},
"defaultValue": "black",
"id": "color",
"name": {
"en_US": "Color"
},
"shared": false,
"slicing": true,
"values": [
{
"value": "red",
"description": {
"en_US": "Red"
},
"image": {
"path": "/images/apple-ipod-classic.jpg",
"absUrl": "https://www.example-image.com/images/apple-ipod-classic.jpg",
"alt": {
"en_US": "iPod"
},
"disBaseUrl": "https://www.dis-base-url/images/apple-ipod-clasic.jpg",
"title": {
"en_US": "iPod"
}
},
"imageSwatch": {
"path": "/images/apple-ipod-classic.jpg",
"absUrl": "https://www.example-image.com/images/apple-ipod-classic.jpg",
"alt": {
"en_US": "iPod"
},
"disBaseUrl": "https://www.dis-base-url/images/apple-ipod-clasic.jpg",
"title": {
"en_US": "iPod"
}
},
"name": {
"color": "Red"
},
"orderable": true,
"position": 2
}
],
"variationAttributeType": "string"
}
Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.
Was this page helpful?