Categories
This is archived documentation. The V2 Catalog API is deprecated. For current API documentation, see the Catalog API.
Categories
Index of hierarchical categories used to organize and group products.
Category Object Properties
List Categories
Gets the list of categories. (Default sorting is by category id, from lowest to highest.)
GET /stores/{store_hash}/v2/categories
Filters
Filter parameters can be added to the URL query string to select specific categories in the collection.
Pagination
Parameters can be added to the URL query string to paginate the collection. The maximum limit is 250. If a limit isn’t provided, up to 50 categories are returned by default.
Response
Example JSON returned in the response:
Get a Category
Gets a single category.
GET /stores/{store_hash}/v2/categories/{id}
Response
Example JSON returned in the response:
Get a Count of Categories
Gets a count of the total number of categories in the store.
GET /stores/{store_hash}/v2/categories/count
Response
Example JSON returned in the response:
Create a Category
Creates a new category.
POST /stores/{store_hash}/v2/categories
Read-only Properties
The following properties of the category are read-only. If one or more of these properties are included in the request, it will be rejected.
- id
- parent_category_list
Requirements
The following properties of the category are required. The request won’t be fulfilled unless these properties are valid.
- name
Note
To maximize system performance, BigCommerce caps the number of categories that can be added to a store at 16,000. If your POST causes the store to exceed the maximum of 16,000 categories, BigCommerce will return a 403 error.
In addition, BigCommerce caps the total number of parent categories at seven. If your POST includes the ID of a parent category in the parent_id field, BigCommerce will check that parent category and its parent and so on to determine the total number of parent categories. If your POST would cause the total number of parent categories to exceed seven, BigCommerce will return a 403 error.
Request
Example request object:
Response
Example JSON returned in the response:
Update a Category
Updates an existing category.
PUT /stores/{store_hash}/v2/categories/{id}
Read-only Properties
The following properties of the category are read-only. If one or more of these properties are included in the request, it will be rejected.
- id
- parent_category_list
Requirements
The following properties of the category are required. The request won’t be fulfilled unless these properties are valid.
Note
To maximize system performance, BigCommerce caps the total number of parent categories at seven. If your PUT includes the ID of a parent category in the parent_id field, BigCommerce will check the parent and any children of the current category to determine the total number of parent categories. If your PUT would cause the total number of parent categories to exceed the maximum of seven, BigCommerce will return a 403 error.
Response
Example JSON returned in the response:
Delete a Category
Deletes a category.
DELETE /stores/{store_hash}/v2/categories/{id}
Delete Products before Categories
The Delete All Categories operation will not succeed unless the store has zero products. If any products in the store belong to any categories, the entire operation will fail. Therefore, if you really want to delete all the categories of the store, you must first delete all of the products in the store.
Delete All Categories
Deletes all the categories in the store.
DELETE /stores/{store_hash}/v2/categories