Docs
Catalog API
Category trees

Catalog - Category trees

The Catalog API manages products, categories, brands, bulk pricing rules, and more. To learn more about catalog resources, see the Catalog overview.

Our Catalog category trees and their categories endpoints are the more modern and performant counterparts to the categories (deprecated) endpoints. Although the category trees endpoints and objects are designed to center an MSF-compatible, multi-tenant category tree architecture, the endpoints work just as well in a single storefront context and support batch requests. Use catalog trees categories endpoints, instead of categories (deprecated) endpoints.

The category trees endpoints let you get the categories for a specific tree, and bulk create, bulk update, and bulk delete categories. You can also bulk update the properties of category trees, which includes changing the channels to which a tree is assigned.

The terms "category tree" and "catalog tree" are used interchangeably throughout the documentation.

To learn more about authenticating Catalog endpoints, locate the Authentication section at the top of each endpoint, then click Show Details.

Resources

Webhooks

Learn more about Category tree webhook events.

Additional Catalog endpoints

Get all category trees

GET /catalog/trees

Request

Returns a list of category trees.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • id:in in query - array

    Filter by supplying a comma-separated list of category tree IDs.

    Type: array[integer]

  • channel_id:in in query - array

    Filter by supplying a comma-separated list of channel IDs.

    Type: array[integer]

example

Response

List of category trees.

Body

object | application/json
  • data
    array[object]

  • meta
    object

example

Upsert category trees

PUT /catalog/trees

Request

Upserts category trees.

This single endpoint updates and creates category trees. If a tree object contains an ID, it is processed as an update operation using that ID. If you do not provide an ID, a new tree is created. The category tree name field is required to create trees, but is not required on the update.

Usage Notes

  • channel_id is required to create a category tree. You can assign one channel_id to one category tree.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • Content-Type in header with default of application/json - string
    required

    The MIME type of the request body.

Body

array | application/json
  • id
    integer

  • name
    string

    >= 1 characters<= 255 characters
  • channels
    array[integer]

example

Response

Created a category tree.

Body

object | application/json
  • data
    array[object]

  • meta
    object

    Response metadata.

example

Delete category trees

DELETE /catalog/trees

Request

Deletes category trees. A filter must be supplied with the endpoint.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • id:in in query - array

    Filter by supplying a comma-separated list of category tree IDs.

    Type: array[integer]

example

Response

Deleted

Get a category tree

GET /catalog/trees/{tree_id}/categories

Request

Returns a category tree.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required

    The MIME type of the response body.

  • tree_id in path - integer
    required

    The ID of the category tree.

  • depth in query - integer

    Max depth for a tree of categories.

example

Response

Categories tree

Body

object | application/json
  • data
    array[object]

  • meta
    object

    Response metadata.

example

Did you find what you were looking for?