This article shares some possible use cases your app could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your app's implementation.
Help merchant organize their hierarchy by creating new categories and subcategories.
category
you need to pass treeReference
to specify the tree in which the category will be created.
The category will be created in the top nesting level of the tree.
Save category.id
from response.
parentCategory.id
to specify the parent category that will be assigned.
The treeReference
will be the same as you sent in step 1.
Replace <parentCategoryId>
with category id from response of step 1.
Help merchant to organize and classify their items by using categories. In this scenario, you will assign set of items to a category and arrange them in a specific order.
In the request path, include category.id
that you received in response of previous scenario.
In the request body treeReference
will also be the same and in items
you can send all items that you want to add to category, Each item is referenced by pair of appId
and catalogItemId
.
items
must be in desired order in which you want to see them.category.id
from previous steps and in the request body, send the following:
Merchant may want to change the position of a category in the hierarchy.
category
you need to also provide parentCategory.id
to specify the parent category that will be assigned.
Save category.id
from response.
category.id
of the category you want to move.
In the request, provide the parentCategoryId
and specify position
as FIRST
to move the subcategory to the beginning.
Replace <parentCategoryId>
with category id from response of previous scenarios.
In this scenario, you want to retrieve a list of all subcategories that belong to a specific parent category, in the correct order. This is useful for traversing the category hierarchy.
Use the Search Categories endpoint.
In the request body, include the parentCategory.id
in the filter
parameter and sort by parentCategory.index
in ascending order:
Replace <parentCategoryId>
with parent category id from previous scenarios.