Crownpeak
  • Product Discovery Developer Guide
  • 🛒Item catalog management
    • What is the Items API?
    • How to work with Items
      • Item Schema
        • Attributes
        • Nested Item Schemas
        • Using the Item Schema API
        • DefaultLocale API
        • Onboarding on/migrating to Fredhopper
        • List of Reserved Attributes
      • Category Tree
        • Using the Category Tree API
        • Onboarding on XO
      • Item Catalog
        • Using the Catalog API
      • Items
        • Using the streaming Items API
        • Using the batch Items API
    • Step by Step guide
      • Step by step guide for Fredhopper customers
    • Feedback
      • Using the Feedback API
    • Authorization to APIs
    • Troubleshooting API errors
  • 🎯XO Recommendations
    • Introduction
    • Using the Recommendations API
    • Setting up the Chrome extension
    • Micro-segmentation
    • XO Legacy APIs
  • 🔎XO Search
    • Introduction
    • Getting started
    • API Reference
      • Search API
      • Autocomplete API (Beta)
      • Product Suggest API
    • API Parameters
      • Search
      • Pagination
      • Faceting
      • Sorting
      • Grouping
      • Filtering
      • Disable features
      • Response mask
      • Context
    • Configuration limitation
  • 🧪A/B testing
    • Fredhopper A/B testing
      • Integration steps for a non-caching solution
      • Integration steps for a caching solution
        • Java SDK Integration
          • Setup
          • Retrieve running A/B tests - Java SDK
          • Filter and request variant - Java SDK
          • Extending the SDK
        • Manual A/B tests integration
          • Retrieve running A/B tests
          • Filter out irrelevant A/B tests
          • Assign variants to user
          • Request variant for page
        • Limitations and Best Practices
  • 📚Resources
    • Glossary
    • Best Practices
      • Tracker Best Practices
      • Items API Best Practices
      • Fredhopper Data Configuration Best Practices
      • Fredhopper Query Response Best Practices
      • Fredhopper Merchandising Studio Best Practices
    • Privacy Notice
  • Archived Pages
    • FHR Tracking plan
    • XO Tracking plan
    • The Tracking API and JS Library
      • What to Track
        • Generic Actions
          • View
          • Click
          • Add to Cart
          • Remove from Cart
          • Purchase
        • Custom Actions
      • Initializing the JavaScript Library
      • REST API Technical Documentation
Powered by GitBook
On this page
  • Definition
  • Structure
  • Localized Name Structure
  • CategoryTree Category
  • Example
  • Validation
  • FHR data model validation
  1. Item catalog management
  2. How to work with Items

Category Tree

It represents a hierarchical category list

Definition

A category tree represents a hierarchical category list. The category tree contains a principal node. This node can have multiple children. Each child is composed of the name and an array of localized names.

As the item schema, the category tree is versioned to be associated in a catalog.

Category Trees aren't mandatory unless you want to associate an item with a category.

Structure

Name
Type
Description

name

String

Name of the root node

tenant

String

Tenant of the account

environment

String

Environment to use

version

Int

The version of the category tree - manage by the API

localizedNames

List

List of objects providing available translations per locale:

{ "locale": "<langcode_countrycode>", "name": "<translation>" }

children

List

list of CategoryTree Category

The root name can't be 0

Localized Name Structure

Name
Type
Description

name

String

Name of the category

locale

String

Based on the Java locale format <languagecode>_<countrycode>

CategoryTree Category

Name
Type
Description

name

String

Name of the root node

localizedNames

List

List of objects providing available translations per locale:

{ "locale": "<langcode_countrycode>", "name": "<translation>" }

children

List

list of CategoryTree Category

Example

{
    "name": "catalog01",
    "localizedNames": [
        {
            "locale": "en_GB",
            "name": "Home"
        },
        {
            "locale": "de_DE",
            "name": "Startseite"
        }
    ],
    "tenant": "demo",
    "environment": "fas:live1",
    "children": [
        {
            "name": "dresses21",
            "localizedNames": [
                {
                    "locale": "en_GB",
                    "name": "Dresses"
                },
                {
                    "locale": "de_DE",
                    "name": "Kleider"
                }
            ],
            "children": [
                {
                    "name": "minidresses31",
                    "localizedNames": [
                        {
                            "locale": "en_GB",
                            "name": "Mini Dresses"
                        },
                        {
                            "locale": "de_DE",
                            "name": "Minikleider"
                        }
                    ]
                },
                {
                    "name": "partydresses32",
                    "localizedNames": [
                        {
                            "locale": "en_GB",
                            "name": "Party Dresses"
                        },
                        {
                            "locale": "de_DE",
                            "name": "Partykleider"
                        }
                    ]
                }
            ]
        },
        {
            "name": "shoes22",
            "localizedNames": [
                {
                    "locale": "en_GB",
                    "name": "Shoes"
                },
                {
                    "locale": "de_DE",
                    "name": "Schuhe"
                }
            ],
            "children": [
                {
                    "name": "boots33",
                    "localizedNames": [
                        {
                            "locale": "en_GB",
                            "name": "Boots"
                        },
                        {
                            "locale": "de_DE",
                            "name": "Stiefel"
                        }
                    ]
                },
                {
                    "name": "sandals34",
                    "localizedNames": [
                        {
                            "locale": "en_GB",
                            "name": "Sandals"
                        },
                        {
                            "locale": "de_DE",
                            "name": "Sandalen"
                        }
                    ]
                },
                {
                    "name": "trainers35",
                    "localizedNames": [
                        {
                            "locale": "en_GB",
                            "name": "Trainers"
                        },
                        {
                            "locale": "de_DE",
                            "name": "Sneaker"
                        }
                    ]
                }
            ]
        }
    ]
}

Validation

Additional validation for category trees:

  • root name should not be empty or “0”

  • categories should have localized names with valid locales

  • each category name should be unique

FHR data model validation

The query parameter fhrValidation=true can be added to enforce Fredhopper specific validation to the category API. This includes the following additional checks to the schema:

  • Category names (aka Category_ids) only contain the alphanumerical characters [A-Za-z0-9] i.e. must only contain uppercase and lowercase Latin letters: A-Z, a-z, and digits: 0-9

PreviousList of Reserved AttributesNextUsing the Category Tree API

Last updated 4 months ago

languagecode is based on the

countrycode is defined by

🛒
ISO 639-1
ISO 3166-1