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
  • Create a category tree
  • Category tree request example
  • Update a category tree
  • List category trees
  • Get a category tree
  • Delete a category tree
  • Api errors
  1. Item catalog management
  2. How to work with Items
  3. Category Tree

Using the Category Tree API

This API required Authentication

Create a category tree

POST /category-trees

Query Parameters

Name
Type
Description

environment*

string

tenant*

string

fhrValidation

String

True/false. Enforces specific validation to comply with the Fredhopper data model

Headers

Name
Type
Description

Authorization*

string

Bearer token

Request Body

Name
Type
Description

categoryTree*

object

Category Tree

{
    "version": 1
}
{
    // Response
}
{
    // Response
}

The root name can't be "0"

Category tree request example

> POST /category-trees
{
    "name": "catalog01",
    "localizedNames": [
        {
            "locale": "en_GB",
            "value": "Home"
        },
        {
            "locale": "de_DE",
            "value": "Startseite"
        }
    ],
    "tenant": "demo",
    "environment": "fas:live1",
    "children": [
        {
            "name": "dresses21",
            "localizedNames": [
                {
                    "locale": "en_GB",
                    "name": "Dresses"
                },
                {
                    "locale": "de_DE",
                    "name": "Kleider"
                }
            ]
        }
    ]
}

Update a category tree

PUT https://items.attraqt.io/category-trees/{name}

Path Parameters

Name
Type
Description

name*

string

Category tree root name

Query Parameters

Name
Type
Description

tenant*

String

environment*

String

fhrValidation

String

True/false. Enforces specific validation to comply with the Fredhopper data model

Headers

Name
Type
Description

Authorization*

string

Bearer token containing the following permission:

Request Body

Name
Type
Description

categoryTree*

object

{
    "version": 2    
}
{
    // Response
}
{
    // Response
}

List category trees

GET https://items.attraqt.io/category-trees

Query Parameters

Name
Type
Description

nameSearchPattern

string

tenant*

string

environment*

string

Headers

Name
Type
Description

Authorization*

string

Bearer token

{
    "categoryTrees": [
      {
        "tenant": "foo",
        "environment": "main",
        "version": 1,
        "name": "root",
        "children": [
          {
            "name": "child-1",
            "localizedNames": [
              {
                "name": "feuille",
                "locale": "fr"
              }
            ],
            "children": []
          }
        ],
        "localizedNames": [
          {
            "name": "racine",
            "locale": "fr"
          }
        ]
      }
    ]
  }

Get a category tree

GET https://items.attraqt.io/category-trees/{name}/{version}

Path Parameters

Name
Type
Description

version*

number

Version of the category tree

name*

string

Category tree root name

Query Parameters

Name
Type
Description

tenant*

String

environment*

String

Headers

Name
Type
Description

Authorization*

string

Bearer token containing the following permission:

 {
  "tenant": "foo",
  "environment": "main",
  "version": 1,
  "name": "root",
  "children": [
    {
      "name": "child-1",
      "localizedNames": [
        {
          "name": "feuille",
          "locale": "fr"
        }
      ],
      "children": []
    }
  ],
  "localizedNames": [
    {
      "name": "racine",
      "locale": "fr"
    }
  ]
}
{
    // Response
}

Delete a category tree

DELETE https://items.attraqt.io/category-trees/{name}/{version}

Path Parameters

Name
Type
Description

version*

number

Version of the category tree

name*

string

Category tree root name

Query Parameters

Name
Type
Description

tenant*

String

environment*

String

Headers

Name
Type
Description

Authorization*

string

Bearer token containing the following permission:

{}
{
    // Response
}
{
    // Response
}

Api errors

Error category
Description

CATEGORY_TREE_NAME

Name is invalid

CATEGORY_TREE_LOCALE

Category tree contain a invalid locale or localized name

CATEGORY_TREE_LEAF

Category tree contain a invalid leaf or leaf name

CATEGORY_TREE_DELETION_USE

CategoryTree is currently used in a Catalog

CATEGORY_TREE_ALREADY_EXISTS

The category tree already exists, use update method

CATEGORY_TREE_NOT_FOUND

Impossible to update the category tree: category tree not exists

PreviousCategory TreeNextOnboarding on XO

Last updated 7 months ago

🛒