get_product_variants
Retrieve product variants for configurable products, showing available option combinations and child SKUs.
Instructions
Get product variants from Catalog Service via gRPC.
This tool calls the GetVariants RPC method to retrieve product variant information
(configurable product options and their values) from the Adobe Commerce Catalog Service.
Product variants represent the different configurations of a configurable product,
showing all available option combinations (like colors, sizes) and their corresponding
child product SKUs.
Args:
environment_id: Adobe Commerce Cloud environment ID (e.g., '3f73a49a-3137-472c-bb0d-39d0e7925d86')
store_view_code: Store view code (e.g., 'test')
store_code: Store code (e.g., 'test')
website_code: Website code (e.g., 'test')
skus: List of parent product SKUs to retrieve variants for
use_tls: Whether to use TLS connection (default: True)
timeout: Request timeout in seconds (default: 15.0)
Returns:
Dict containing variant information with keys:
- variants: List of variant dictionaries, each containing:
- id: Variant identifier
- parent_sku: Parent product SKU
- product_sku: Child product SKU for this variant
- option_values: List of option values (attribute_code, uid, value_index)
- count: Number of variants retrieved
- status: Success or error status
Example:
>>> result = get_product_variants(
... environment_id='3f73a49a-3137-472c-bb0d-39d0e7925d86',
... store_view_code='test',
... store_code='test',
... website_code='test',
... skus=['CAT-249']
... )
>>> print(result['count'])
4
>>> for variant in result['variants']:
... print(f"{variant['product_sku']}: {[opt['attribute_code'] for opt in variant['option_values']]}")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skus | Yes | ||
| timeout | No | ||
| use_tls | No | ||
| store_code | Yes | ||
| website_code | Yes | ||
| environment_id | Yes | ||
| store_view_code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |