Product Categories¶
URI: /products/productid/categories¶
Allows you to retrieve information about assigned categories, assign, and unassign a category from/to a product.
URL Structure: https://om.ddev.site/api/rest/products/productid/categories
Version: 1
HTTP Method: GET¶
Description: Allows you to retrieve information about categories assigned to the specified product.
Authentication: Admin, Customer
Default Format: JSON
Parameters: No Parameters
Response Body¶
HTTP Method: POST¶
Description: Allows you to assign a category to a specified product.
Authentication: Admin
Default Format: JSON
Parameters:
Name | Description | Required | Type | Example Value |
---|---|---|---|---|
category_id | The category ID | required | int | 2 |
Request Body¶
As a result, the category with ID equal to 2 will be assigned to the specified product.
URI: /products/productid/categories/categoryid¶
HTTP Method: DELETE¶
Description: Allows you to unassign a category from a specified product.
Authentication: Admin
Default Format: JSON
Parameters: No Parameters
HTTP Status Codes¶
Status Code | Message | Description |
---|---|---|
400 | Product | The message is returned when the required category is already assigned to the product |
400 | Category not found | The specified category is not found |
405 | Resource method not implemented yet | The specified method is not implemented yet |