Categories

Generic properties

Attribute type idType specific restriction parameters
idCategory id - used internally by PDX. Attribute id can not be blank and can only contain alphanumeric characters, plus specific special characters: “ -_#:” (including space).
nameCategory name visible in the PDX UI. Can not be blank.
descriptionCategory description. Not mandatory.
leafMarks a category as a leaf category, meaning it can not have any child categories. Products can only be added to leaf categories.
parentIdSpecifies category’s parent category. All categories but root category have to have parent category.
attributeLinksLinks 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).
businessRuleScopesSpecifies business rule scopes to run.

Attribute link properties

Attribute type idType specific restriction parameters
idAttribute id linked to this category. In case of composite attributes, only composite root attribute should be linked.
optionalSpecifies attribute mandatoriness for submission. Attributes are optional by default (optional = true).
initRequiredSpecifies attribute mandatoriness for initialization. Attributes are optional by default (initRequired = false).
appliesToSpecifies if attribute is a family or variant attribute, or both. Possible values are: ALL, VARIANT, FAMILY. Default is ALL.
listOfValuesFilterAllows to filter listOfValues for this attribute for this category.
defaultValueAllows 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"
} ]