# assignAttributeValueToProduct

## Overview

Assigns an attribute value to a product, defining the product's variant axes. Must be called before the product is activated, as activation locks the axis structure.

## Modules Commands Used

- [product-management] AssignAttributeValueToProduct

## Exception Handling

| Error Code | Description |
| --- | --- |
| PRODUCT_MANAGEMENT_PRODUCT_NOT_FOUND | The specified product does not exist |
| PRODUCT_MANAGEMENT_ATTRIBUTE_NOT_FOUND | The specified attribute does not exist |
| PRODUCT_MANAGEMENT_INVALID_VALUE | The specified attribute value does not exist |
| PRODUCT_MANAGEMENT_AXIS_STRUCTURE_LOCKED | Product is already activated; axis structure cannot be modified |
| PRODUCT_MANAGEMENT_PRODUCT_ARCHIVED | Cannot modify an archived product |
