Categories
Describes the Categories API handler in Optimizely Configured Commerce.
HTTP Verb – GET
URL – /api/v1/categories
Description – Return a collection of hierarchical categories.
Base – HandlerBase<GetCategoryCollectionParameter, GetCategoryCollectionResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetMaxDepth | Populates the max depth to search for categories. The MaxDepthproperty on the parameter object is used if it has a value, otherwise the Catalog "Category Menu Depth" setting is used. When the setting is used, the depth is limited to 3. The max depth is stored in the MaxDepthproperty on the result object. |
600 | GetStartCategory | Retrieves the category from where the category tree will begin. If the StartCategoryIdproperty on the parameter object has no value, this handler is skipped. The category is stored in the StartCategoryproperty on the result object. |
700 | GetBaseLink | Sets result BaseLink to blank if the start category is null, otherwise to the url of the start category. |
800 | GetCategories | If the StartCategory property on the parameter object is not null, the application retrieves the active base categories (root categories). Otherwise, the application retrieves the subcategories for the category stored in the StartCategoryproperty. The result is stored in the Categoriesproperty on the result object. |
900 | CreateCategoryNavLinks | Transforms the category tree into a collection of NavLinkDtoobjects that contain information like the URL path, name, and subcategories. The StartCategorycategory is not included in the category tree. |
HTTP Verb – GET
URL – /api/v1/categories/{categoryId}
Description – Return a single category
Base – HandlerBase<GetCategoryParameter, GetCategoryResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetCategory | Retrieves a category using the CategoryId property on the parameter object. If a category is not found or the category is not assigned to the current website, an error is returned. The category is stored in the Category property on the result object. |
600 | CopyCustomPropertiesToResult | Copies custom properties configured for the category entity to the Properties property on the result object. |
Updated over 1 year ago