Assigning items to a category
Assigning items to a category ensures that the settings are inherited from the category.
After the link is established between the item and category, it is not necessary to update the item if the category definition is modified.
PATCH https://api.watsoncommerce.ibm.com/catalog/{tenantId}/v1/itemCategories
{
"itemId": "KROO_001",
"unitOfMeasure": "EACH",
"itemCategories": [
"/Department/KangarooFit/boy/jeans"
]
}
After the item KROO_00
1 is assigned to
/Department/KangarooFit/boy/jeans
, the item must automatically inherit the item
attribute from the parent categoryPath
, which is
/Department/KangarooFit
. You can verify by invoking the GET Item
details API.
GET https://api.watsoncommerce.ibm.com/catalog/{tenantId}/v1/itemDetails?itemId=KROO_001&unitOfMeasure=EACH
{
"itemId": "KROO_001",
"unitOfMeasure": "EACH",
"primaryInformation": {...},
"inventoryInformation": {...},
"inventoryTagInformation": {...},
"code": {..},
"itemCategories": ["/Department/KangarooFit/boy/jeans"],
"itemAssignedAttributes": [
{
"itemAttributeName": "Material",
"itemAttributeGroupPath": "/KangarooFit/Material",
"inheritedValues": ["FlexoDenim"]
}
]
}
From the payload, it is observed that an itemAssignedAttribute
of Material and
inheritedValue=FlexoDenim
is derived from the parent category level. For any other
items that need to inherit the item attribute values, add in the same way against the category.
inheritedValues
so that the catalog manager can differentiate
the source setting as shown in the following example.
"itemAssignedAttributes": [ {
"itemAttributeName": "Display Type",
"itemAttributeGroupPath": "/TV/DisplayDefinition",
"values": ["QLED"]
} ]
The example demonstrates the powerful inheritance hierarchy with the use of category and enables the overall upkeep time and cost reduction on attribute definition for the catalog manager.