Categories
Generic properties
Attribute type id | Type specific restriction parameters |
---|---|
id | Category id - used internally by PDX. Attribute id can not be blank and can only contain alphanumeric characters, plus specific special characters: “ -_#:” (including space). |
name | Category name visible in the PDX UI. Can not be blank. |
description | Category description. Not mandatory. |
leaf | Marks a category as a leaf category, meaning it can not have any child categories. Products can only be added to leaf categories. |
parentId | Specifies category’s parent category. All categories but root category have to have parent category. |
attributeLinks | Links attribute with category. Multiple properties of this relation can be defined - see section below. Attribute links are inherited from higher level categories but can be overwritten on lower levels (i.e. by changing attribute mandatoriness). |
businessRuleScopes | Specifies business rule scopes to run. |
Attribute link properties
Attribute type id | Type specific restriction parameters |
---|---|
id | Attribute id linked to this category. In case of composite attributes, only composite root attribute should be linked. |
optional | Specifies attribute mandatoriness for submission. Attributes are optional by default (optional = true). |
initRequired | Specifies attribute mandatoriness for initialization. Attributes are optional by default (initRequired = false). |
appliesTo | Specifies if attribute is a family or variant attribute, or both. Possible values are: ALL, VARIANT, FAMILY. Default is ALL. |
listOfValuesFilter | Allows to filter listOfValues for this attribute for this category. |
defaultValue | Allows to set default value for attribute for this category. |
Packaging category
If channel implements packaging it has to define special packaging category. This category has to be configured as a packaging primary category in datastandard. With SDK this can be achieved by creating packaging category with the builder method CategoryBuilder#packagingCategory.
Category packaging = CategoryBuilder.packagingCategory("PACKAGING", "Packaging products")
.withParentId(rootCategory.getId()).build();
"primaryCategories": {
"packaging": "PACKAGING""
}
Code Examples:
AttributeLink gtinLink = AttributeLinkBuilder.defaultLink("GTIN").withOptional(false).build();
Category rootCategory = CategoryBuilder.regularCategory("ROOT", "Root category").withAttributeLink(gtinLink).build();
Category packaging = CategoryBuilder.packagingCategory("PACKAGING", "Packaging products").withParentId(rootCategory.getId()).build();
Category regularProduct = CategoryBuilder.regularCategory("regularProduct", "Regular products").withParentId(rootCategory.getId()).build();
Category apparelAccessories = CategoryBuilder.regularCategory("apparelAccessories", "Apparel & Accessories").withParentId(regularProduct.getId()).build();
Category artsEntertainment = CategoryBuilder.regularCategory("artsEntertainment", "Arts & Entertainment").withParentId(regularProduct.getId()).build();
[ {
"id" : "ROOT",
"name" : "Root category",
"attributeLinks" : [ {
"id" : "GTIN",
"appliesTo" : "ALL"
} ]
}, {
"id" : "PACKAGING",
"name" : "Packaging products",
"leaf" : true,
"parentId" : "ROOT"
}, {
"id" : "regularProduct",
"name" : "Regular products",
"parentId" : "ROOT"
}, {
"id" : "apparelAccessories",
"name" : "Apparel & Accessories",
"leaf" : true,
"parentId" : "regularProduct"
}, {
"id" : "artsEntertainment",
"name" : "Arts & Entertainment",
"leaf" : true,
"parentId" : "regularProduct"
} ]
Updated over 1 year ago