# Categories

Group your catalog's products. Addressed by `token`.

 - [GET /categories](https://docs.dimepay.net/apis/v2/dime-v2/categories/listcategories.md): Returns your categories, newest first. Cursor-paginated.
 - [POST /categories](https://docs.dimepay.net/apis/v2/dime-v2/categories/createcategory.md): Creates a category. The `slug` must be unique among your categories.
 - [GET /categories/{token}](https://docs.dimepay.net/apis/v2/dime-v2/categories/retrievecategory.md)
 - [PUT /categories/{token}](https://docs.dimepay.net/apis/v2/dime-v2/categories/updatecategory.md): Full replacement, not a patch: an optional field you omit is cleared, and an omitted `is_active` reverts to `true`.
 - [DELETE /categories/{token}](https://docs.dimepay.net/apis/v2/dime-v2/categories/deletecategory.md): Fails with `409` while any product is still in the category. Remove them first.
 - [GET /categories/{token}/products](https://docs.dimepay.net/apis/v2/dime-v2/categories/listcategoryproducts.md): Every product in the category. Not paginated; `has_more` is always `false`.
 - [GET /products/{token}/categories](https://docs.dimepay.net/apis/v2/dime-v2/categories/listproductcategories.md): Every category the product is in. Not paginated; `has_more` is always `false`.
 - [PUT /products/{token}/categories/{category_token}](https://docs.dimepay.net/apis/v2/dime-v2/categories/attachproductcategory.md): Adds the product to the category and returns the product's categories. Fails with `409` if the product is already in it.
 - [DELETE /products/{token}/categories/{category_token}](https://docs.dimepay.net/apis/v2/dime-v2/categories/detachproductcategory.md): Removes the product from the category and returns the product's remaining categories.
