The Categories resource (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_back/llms.txt
Use this file to discover all available pages before exploring further.
/inventario/categorias) lets you organise your inventory into named groups. Every Producto belongs to exactly one Categoria, so categories must exist before products can be created. All write operations are audited — the API records which user created or last updated each record via id_user_create / id_user_update. Deletion is always a soft delete: the record remains in the database with estado set to false, preserving referential integrity with linked products.
All endpoints in this section require a valid JWT access token. Include it as
Authorization: Bearer <access_token> on every request.The Categoria object
Auto-incremented primary key.
Unique display name of the category (max 100 characters).
true while the category is active. Set to false by a soft delete.ID of the user who created this record.
ID of the user who last updated this record.
ISO 8601 timestamp of record creation.
ISO 8601 timestamp of the last update.
Products linked to this category. Only included when the relation is eagerly loaded by the service.
Endpoints
Create a category
POST /inventario/categorias
Creates a new inventory category. The nombre field must be unique across all categories — attempting to insert a duplicate name returns a database constraint error.
Request body
The category name. Must be a non-empty string of at most 100 characters. Must be unique.
Numeric ID of the authenticated user performing the creation. Stored for audit purposes.
Example
Response 200 OK
List all active categories
GET /inventario/categorias
Returns an array of all categories whose estado is true. Soft-deleted categories (estado = false) are automatically filtered out and will never appear in this list.
Inactive (soft-deleted) categories are excluded from this response. To inspect a deleted category you must query it directly by ID.
Example
Response 200 OK
Get a category by ID
GET /inventario/categorias/:id
Retrieves a single category by its numeric primary key, regardless of its estado. Use this endpoint to inspect soft-deleted categories.
Path parameters
The numeric primary key of the category.
Example
Response 200 OK
Update a category
PATCH /inventario/categorias/:id
Partially updates an existing category. All body fields are optional — supply only the fields you want to change. The updated_at timestamp is refreshed automatically.
Path parameters
The numeric primary key of the category to update.
Request body
New category name (max 100 characters). Must remain unique if changed.
Numeric ID of the authenticated user performing the update. Stored for audit purposes.
Example
Response 200 OK
Delete a category (soft delete)
DELETE /inventario/categorias/:id
Soft-deletes a category by setting its estado field to false. The record is not physically removed from the database. The category will no longer appear in GET /inventario/categorias responses, but it remains accessible by ID and continues to satisfy any existing foreign-key relationships.
Path parameters
The numeric primary key of the category to soft-delete.
Example
Response 200 OK
Returns an empty body with HTTP status 200.