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 endpoints are the more modern and performant counterparts to the Categories 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.
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 /stores/{store_hash}/v3/catalog/trees
Request
Returns a list of Category Trees.
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.
- id:in in query - string
- channel_id:in in query - string
example
curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/trees' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
List of category trees.
Body
dataarray[object]
metaobject
example
{ "data": [ { "id": 0, "name": "string", "channels": [ 0 ] } ], "meta": { "pagination": { "total": 246, "count": 5, "per_page": 5, "current_page": 1, "total_pages": 50, "links": { "next": "?limit=5&page=2", "current": "?limit=5&page=1" } } } }
Upsert Category Trees
PUT /stores/{store_hash}/v3/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 onechannel_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
idinteger
namestring
>= 1 characters<= 255 characterschannelsarray[integer]
example
[ { "id": 0, "name": "string", "channels": [ 0 ] } ]
Response
Created a category tree.
Body
dataobject
metaobject
Response metadata.
example
{ "data": { "id": 0, "name": "string", "channels": [ 0 ] }, "meta": { "type": "object", "properties": {}, "description": "Empty meta object; reserved for use later." } }
Delete Category Trees
DELETE /stores/{store_hash}/v3/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
- Accept in header with default of application/json - string - required
The MIME type of the response body.
- id:in in query - string
example
curl --request DELETE \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/trees' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
Deleted