# Categories Managing categories in the e-shop. ## List of product categories - [GET /api/categories](https://api.docs.shoptet.com/shoptet-api/openapi/categories/getlistofproductcategories.md): Returns the list of product categories. ## Product category create - [POST /api/categories](https://api.docs.shoptet.com/shoptet-api/openapi/categories/createproductcategory.md): Creates new category ## Product category detail - [GET /api/categories/{categoryGuid}](https://api.docs.shoptet.com/shoptet-api/openapi/categories/getproductcategorydetail.md): Returns category info ## Product category update - [PATCH /api/categories/{categoryGuid}](https://api.docs.shoptet.com/shoptet-api/openapi/categories/updateproductcategory.md): Updates existing category. ## Product category deletion - [DELETE /api/categories/{categoryGuid}](https://api.docs.shoptet.com/shoptet-api/openapi/categories/deleteproductcategory.md): Deletes product category as per entered categoryGuid. If successful, returns the code 200. If the category does not exist within the e-shop, a 404 code is returned. If the category cannot be deleted, because it is used by some product or has children, a 409 code is returned. Optional parameter deleteUsed allows deleting categories used by products. The products are marked as changed. Optional parameter deleteChildren allows deleting categories with child categories. The children are deleted too. ## Product category BATCH update - [PATCH /api/categories/batch](https://api.docs.shoptet.com/shoptet-api/openapi/categories/updateproductcategorybatch.md): This endpoint allows you to update multiple categories at once. Batch update is processed asynchronously in same way as for example products snapshot, but it does not have resultUrl with categories to download in response. Instead, you can check attribute log which contains successfully updated categories and errors. See how Asynchronous requests work on our developer's portal. File with data for update must be in JSONL (jsonlines) format. Each line must contain one category in JSON format. Maximum size of file is 100MB. Structure of JSON row is same as structure of JSON for single category update above. You can add one extra optional attribute "language" which defines language of updating category, so you are able to update multiple language attributes (i.e. "name", "description" etc.) of one category in one batch file. If language is not defined, default language of shop is used. See Category batch update schema for more details. Asynchronous job process jsonl file row by row and try to validate and save data. If there is any error, row is skipped and error is logged, but it does not stop processing of other rows. In Log, every product is identified by its position in file (starting from 1). ## Category products priority BATCH update - [PATCH /api/categories/products-priority/batch](https://api.docs.shoptet.com/shoptet-api/openapi/categories/updatecategoryproductsprioritybatch.md): This endpoint allows you to update multiple categories with product priorities at once. Batch update is processed asynchronously in same way as for example products snapshot, but it does not have resultUrl in response. Instead, you can check attribute log which contains successfully updated categories and errors. See how Asynchronous requests work on our developer's portal. File with data for update must be in JSONL (jsonlines) format. Each line must contain one category with product priorities in JSON format. Maximum size of file is 100MB. Structure of JSON row is defined by Category product priority batch update schema. Asynchronous job process jsonl file row by row and try to validate and save data. If there is any error, row is skipped and error is logged, but it does not stop processing of other rows. In Log, every product is identified by its position in file (starting from 1). ## List of products order in category - [GET /api/categories/{categoryGuid}/productsPriority](https://api.docs.shoptet.com/shoptet-api/openapi/categories/getlistofproductsorderincategory.md): Retrieves products and their priorities within a category. ## Update product order in category - [PATCH /api/categories/{categoryGuid}/productsPriority](https://api.docs.shoptet.com/shoptet-api/openapi/categories/updateproductorderincategory.md): Using this endpoint you can update product priority within a category. You can request multiple updates at once; the maximum is 300 updates per request. In case of a partial failure, the response code will be 200 OK and the errorneous items will be listed in the errors array. In case of a complete failure, response code will be 400 BAD REQUEST. Minimum priority is 0, maximum priority is 65535.