Manage product categories
Once you have access to the eCommerce platform, define the categories your products belong to. Categories should be the first object type you import into your account.
Create a category
To create a category, see eCommerce > Create/Update a category in the API reference. Below is an example of body parameters used to create or update a category.
cURL Request
The cURL request shows the parameters used to create a category. Default values for each parameter are shown below.
Body parameters
Update a category
Update a category by setting updateEnabled to true in the create request.
You can then change the category’s name and URL and run the request to update it.
Response codes
Retrieving all categories
Retrieve the categories you added by calling the eCommerce > Return all your categories API endpoint. The attributes used to return all your categories are below.
cURL Request
Parameters to retrieve all categories:
Retrieving a category’s details
Get a category’s details by passing its ID to the get a category details endpoint.
This endpoint has only one attribute:
Creating categories in a batch
Send your product categories in batches instead of adding each one individually. A cURL request for creating categories in a batch is below.
Use the cURL request to call the batch endpoint for categories. The boolean attribute updateEnabled enables or disables updates for all categories being imported.
categories is an array of objects. Its sub-attributes are:
JSON Payload
Good practices for importing category batches
- You can create up to 100 categories per call. The sub-attributes for categories match the attributes in create a category above.
- Add the correct category URL to the JSON payload.
- All attributes are of type string.