The Categories API lets you group products into logical collections that aid navigation and reporting throughout Credith. Each category has a human-readable name and a description, and carries anDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/RoyGeova07/Credith/llms.txt
Use this file to discover all available pages before exploring further.
isActive flag that can be toggled without deleting the record. Categories are linked to products through the products_categories join table — a single product can belong to multiple categories, and a category can contain many products. Category names are stored in lowercase and must be unique; attempting to create or rename a category to a name that already exists returns a 400 error.
List Categories
createdAt descending (newest first). Accessible by OWNER, ADMIN, and EMPLOYEE roles.
Maximum number of categories to return per page.
Number of records to skip before returning results. Used for pagination.
Create Category
OWNER role. Both name and description are required and cannot be blank. The name is trimmed and converted to lowercase before being stored. If a category with the same normalized name already exists, the request is rejected with 400.
The category name. Trimmed of leading/trailing whitespace and lowercased before storage. Must be unique.
A short description explaining what kinds of products belong to this category. Cannot be blank.
Category names are compared after lowercasing and trimming. Submitting
"Bebidas", "BEBIDAS", or " bebidas " will all be treated as duplicate of an existing "bebidas" category and will return a 400 error.Update Category
name and/or description of an existing category. Requires OWNER role. Both fields are required in the request body. The uniqueness check is applied to the new name — it is allowed to match the current record’s own name (i.e., you can re-save without changing the name).
UUID of the category to update.
New name for the category. Trimmed and lowercased before storage. Must be unique (excluding the current record).
Updated description for the category. Cannot be blank.
Activate Category
isActive to true on the specified category. Returns 400 if the category is already active. Requires OWNER role.
UUID of the category to activate.
Deactivate Category
isActive to false on the specified category. Returns 400 if the category is already inactive. Requires OWNER role. Deactivating a category does not remove it from the database or unlink it from existing products.
UUID of the category to deactivate.
Category Object
Unique identifier for the category. Auto-generated as UUIDv4.
The category name, stored in lowercase. Unique across all categories.
Human-readable description of the category’s purpose.
Indicates whether the category is currently active. Controlled via the activate/deactivate endpoints.
Timestamp when the category was created.
Timestamp of the last update to the category record.
Role Requirements
| Endpoint | Required Role |
|---|---|
GET /api/categories | OWNER, ADMIN, EMPLOYEE |
POST /api/categories | OWNER |
PUT /api/categories/:categoryId | OWNER |
PATCH /api/categories/:categoryId/activate | OWNER |
PATCH /api/categories/:categoryId/deactivate | OWNER |
Error Responses
| Status | Meaning |
|---|---|
400 | Missing or blank name/description, duplicate category name, or toggling a status that is already set |
404 | Category with the specified categoryId not found |
500 | Unexpected server error |