For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
        • Brands
        • Categories
        • Category Trees
            • GETList Category Trees
            • PUTUpsert Category Trees
            • DELDelete Category Trees
            • GETGet Category Tree
        • Products
        • Product Modifiers
        • Product Variants
        • Product Variant Options
      • Payments
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTAdminCatalogCategory Trees

Upsert Category Trees

PUT
https://api.bigcommerce.com/stores/:store_hash/v3/catalog/trees
PUT
/stores/:store_hash/v3/catalog/trees
$curl -X PUT https://api.bigcommerce.com/stores/store_hash/v3/catalog/trees \
> -H "Accept: application/json" \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '[
> {
> "id": 12345,
> "name": "Spring Collection 2024",
> "channels": []
> },
> {
> "id": 0,
> "name": "Summer Specials",
> "channels": [
> 101
> ]
> }
>]'
1{
2 "data": [
3 {
4 "id": 12345,
5 "name": "Spring Collection 2024",
6 "channels": []
7 },
8 {
9 "id": 67890,
10 "name": "Summer Specials",
11 "channels": [
12 101
13 ]
14 }
15 ],
16 "meta": {}
17}
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 in the `channels` field is required to create a category tree. You can only assign a category tree to one channel. * The `channels` field must be absent when updating a category tree. This field is currently unsupported during a category tree update.
Was this page helpful?
Previous

List Category Trees

Next

Delete Category Trees

Built with

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 in the channels field is required to create a category tree. You can only assign a category tree to one channel.
  • The channels field must be absent when updating a category tree. This field is currently unsupported during a category tree update.

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Products | modify | `store_v2_products` | | Products | read-only | `store_v2_products_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json

The MIME type of the response body.

Request

This endpoint expects a list of objects.
idintegerOptional
namestringOptional1-255 characters
channelslist of integersOptional

Response

Created a category tree.
datalist of objects
metaobject
Response metadata.

Errors

403
Forbidden Error
422
Unprocessable Entity Error

OAuth scopes

UI NamePermissionParameter
Productsmodifystore_v2_products
Productsread-onlystore_v2_products_read_only

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.