younifyd
Menu

Get Variations For Master Product

List all variations of a master product.

GET/organizations/{organizationId}/products/{masterProductId}/variations

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Get Variations For Master Product action (under Products (Data API)).
  3. Fill in the fields below, then reference the result from later steps as {{getVariationsForMasterProduct.response.data}}.

Request

Path parameters

masterProductIdstringrequired

The ID of the master product that contains the variation group.

organizationIdstringrequired

An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).

Query parameters

siteIdstring

The site context.

limitinteger (int32)

Number of records to retrieve per request. Must be between 1 (minimum) and 50 (maximum). Defaults to 25.

Default 25

offsetinteger (int32)

Used to retrieve the results based on a particular resource offset.

Default 0

Response

Returns 200 with an object. Read it in later steps with {{getVariationsForMasterProduct.response.data.<field>}}.

dataarray<object>

An array of variants.

atsnumber (double)

The Available To Sell (ATS) inventory value of the product. This is a calculated value.

defaultProductVariationboolean

A flag indicating whether the variant is a default variant.

imageobject5 fields

Document representing media file.

inStockboolean

True if the product is in stock, false if not.

onlineboolean

If the product is currently online. True if online, false if not.

orderableboolean

A flag indicating whether the variant is orderable.

pricenumber (double)

The sales price of the variant.

priceCurrencystring

Currency code for the price of the product.

productIdstringrequired

The id (SKU) of the product.

searchableobject

A flag indicating whether the variant is searchable.

variationAttributesarray<object>9 fields

Variation attributes.

variationValuesobject

The actual variation attribute ID - value pairs.

json
{
  "data": [
    {
      "productId": "apple-ipod-classic",
      "ats": 10,
      "defaultProductVariation": true,
      "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"
        }
      },
      "inStock": true,
      "online": true,
      "orderable": true,
      "price": 29.99,
      "priceCurrency": "USD",
      "searchable": {
        "Site1": true
      },
      "variationAttributes": [
        {
          "attributeDefinitionId": "color",
          "attributeDefinitionName": {
            "en_US": "Color"
          },
          "defaultValue": "black",
          "id": "color",
          "name": {
            "en_US": "Color"
          },
          "shared": false,
          "slicing": true,
          "values": [
            {
              "value": null,
              "description": null,
              "image": null,
              "imageSwatch": null,
              "name": null,
              "orderable": null,
              "position": null
            }
          ],
          "variationAttributeType": "string"
        }
      ],
      "variationValues": {
        "color": "black"
      }
    }
  ]
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.