Creating categories
You must create categories individually for each level.
Create a category individually for each level by using the example,
/KangarooFit/boy/jeans. The user must make calls to three categories to create
a directory structure as shown.
- /Department/KangarooFit (
ItemAttributeMaterial =FlexoDenimmust be included at the beginning to demonstrate inheritance functionality) - /Department/KangarooFit/boy
- /Department/KangarooFit/boy/jeans
Note: The
categoryPath must use the forward slash notation as a separator between
levels, and must begin with /at the root level. The
categoryPath must also
include a root level domain. In this case, /Department. The item attribute
might not apply to the root level hierarchy.To create these categories, call the Upsert Category API.
- Input 1
- Create for /Department/KangarooFit and apply the
itemAttribute, Material =FlexoDenim.POST https://api.watsoncommerce.ibm.com/catalog/{tenantId}/v1/category { "categoryId": "KangarooFit", "categoryPath": "/Department/KangarooFit", "itemAttributes": [ { "itemAttributeName": "Material", "itemAttributeGroupPath": "/KangarooFit/Material", "assignedValues": ["FlexoDenim"] } ] } - Input 2
- Create for /Department/KangarooFit/boy without the
itemAttributeat this level.POST https://api.watsoncommerce.ibm.com/catalog/{tenantId}/v1/category { "categoryId": "KangarooFit", "categoryPath": "/Department/KangarooFit/boy", ] } - Input 3
- Create for /Department/KangarooFit/boy/jeans without the item attribute at
this
level.
POST https://api.watsoncommerce.ibm.com/catalog/{tenantId}/v1/category { "categoryId": "KangarooFit", "categoryPath": "/Department/KangarooFit/boy/jeans", ] }
itemAttributedeclaration is explicitly excluded as the decision is to define the attribute at the parent level /Department/KangarooFit that it is inherited by its subgroup.