---
schema_version: "1"
id: 4031bdada37d165ddbb9d2aa43e0eb545fe0843ee51ca2d6a20528ef9e142674
title: Script API Support for Variation Groups
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_api_support.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_api_support.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e8281e007acd2946f8b28d11e8b07c9e40bb1b71871824e300734037ba013d08
description: The B2C Commerce Script API supports variation groups.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Script API Support for Variation Groups

The B2C Commerce Script API supports variation groups.

Use the Script API with variation groups as follows: When reading attribute values, when there’s a fallback from a variation product to base product in the case the variant doesn't define an attribute value. There’s no fallback from variation product to variation group if the variation product doesn't define an attribute value. However, there’s a fallback from a variation group to a base product in case the variation group doesn't define an attribute value.

- `dw.catalog.Variant` class has attribute fallback behavior to first obtain attributes from (one or more) assigned variation groups and then from the base product.
- `dw.catalog.VariationGroup` class has attribute fallback behavior to obtain attributes from the base product, when the attribute isn't specified by the variation group.
- `dw.catalog.Product` class checks if the product is of type variation group through the public boolean `isVariationGroup();` method.
- `dw.catalog.Product` class returns all assigned variation groups of a base product through the public Collection `getVariationGroups();` method.
- `dw.catalog.ProductVariationModel` class returns all assigned and online variation groups of the corresponding base product via the public Collection `getVariationGroups()`; method.
- `dw.catalog.ProductVariationModel` class returns configured variation values for variation group products via the public `ProductVariationAttributeValue` `getVariationValue( Product variantOrVariationGroup, ProductVariationAttribute attribute` ); method.