Export and import category data

Data from categories (collections) can be exported or imported from external systems.

Once you have set up these items, as outlined in Understand catalogs, you can share their data.

Collections can link to an independent collection or a product. Navigation and non-navigation categories of any standard catalog can update all attributes.

The fixedChildProducts attribute for all root categories should be empty as a product cannot be linked directly to root categories. If you are trying to update the fixedChildProducts attribute while performing a root category update, link the product to the defaultCategoryForProducts category of the specific catalog, if present, or ignore if not present.

Note that catalog navigation and non-navigation categories cannot be a child category of any other category. When you create a category, it is linked to the root navigation category. If you set orphaned=true, the category is created as an orphan. If a valid standard catalog ID is provided, the category is linked to the navigation category of the specified catalog. Note that an error occurs if the Master View catalog ID is provided because a new category cannot be linked to a Master View catalog.

When you remove a category from the default master catalog, you must remove the same category from all of the Master View catalogs, if present, as the Master View catalogs should contain only the categories available in the master catalog.

The following is an example of a request:

{
  "catalogId": "cat_1",
  "orphaned": false,
  "displayName": "Drama",
  "fixedChildCategories": [
    {
      "id": "cat40011"
    },
    {
      "id": "cat40010"
    }
  ],
  "active": true,
  "id": "cat40015",
  "fixedChildProducts": []
}

Note that when exporting a catalogId, orphaned attributes will not be exported.

The following is an example of a response:

{
  "longDescription": null,
  "childProductsCount": 0,
  "route": "/drama/category/cat40015",
  "categoryImages": [],
  "displayName": "Drama",
  "categoryPaths": [
    "/Cloud Catalog/Storefront Navigation/Movie Store Root/Drama",
    "/QA Movie and Games Catalog/Storefront Navigation/Movie Store Root/Drama"
  ],
  "translations": {
    "items": [
      {
        "longDescription": null,
        "displayName": "Drama",
        "description": null,
        "lang": "en"
      }
    ]
  },
  "fixedChildCategories": [
    {
      "displayName": "Award Winners",
      "id": "cat40011"
    },
    {
      "displayName": "Sports",
      "id": "cat40010"
    }
  ],
  "seoDescriptionDerived": "Drama",
  "active": true,
  "categoryIdPaths": [
    "cloudCatalog>cat100058>cat40013>cat40015",
    "cloudLakeCatalog>rootCategory>cat40013>cat40015"
  ],
  "id": "cat40015",
  "fixedChildProducts": []
}

The following section describes the fields and validation that occurs when exporting or importing category data.

Categories export and import fields

The following fields are exported and imported for categories:

Field Name Description
longDescription The description of the category.
fixedChildProducts Any child products associated with the category. The Id field is used to identify the fixed child products.
categoryImages Images associated with the category.
displayName The name that is displayed with the category.
Id The ID of the category.
fixedChildCategories Any child categories associated with the category. From this field, you can access the Id and displayName fields for fixed child categories.
seoDescriptionDerived Indicates if the description of the SEO has been derived.
active Indicates if the category is active.
route Non-writable. For export only.
categoryIdPaths Non-writable. For export only.
categoryPaths Non-writable. For export only.

Category validations

Additionally, the following validations are performed when importing categories:

  • The required category ID is not null and contains only alphanumeric, underscore (_) or dash (-) characters.
  • The required image name and path are valid.
  • The products for given product IDs in fixedChildProducts are available in the repository.
  • The new parent category of child categories is valid.
  • The fixedChildCategory array contains valid categories.
  • The display name is valid.

For detailed information on catalogs and categories, refer to Understand catalogs.