Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_front/llms.txt

Use this file to discover all available pages before exploring further.

Categories are the top-level grouping for all inventory items in Kantuta POS. Every product must belong to a category, so managing categories is a prerequisite for building out your product catalog. All routes require a valid Bearer Token JWT in the Authorization header. The list endpoint automatically filters out inactive (soft-deleted) categories, so only records with estado: true are returned.

Interface Reference

// Base audit fields shared by all entities
export interface BaseEntityAudit {
  estado: boolean;
  id_user_create: number | null;
  id_user_update?: number | null;
  created_at: string; // ISO Date String
  updated_at: string; // ISO Date String
}

export interface Categoria extends BaseEntityAudit {
  id: number;
  nombre: string;
  productos?: Producto[]; // Populated when fetching by ID
}

GET /inventario/categorias

Returns the list of all active categories. Inactive (soft-deleted) categories are automatically excluded from this response. Authentication: Required — Authorization: Bearer <access_token>

Response Fields

id
number
required
Unique identifier for the category.
nombre
string
required
Display name of the category (max 100 characters).
estado
boolean
required
Active flag. Always true in list responses (inactive records are filtered out).
id_user_create
number | null
required
ID of the user who created this category.
id_user_update
number | null
ID of the last user to update this category.
created_at
string
required
ISO 8601 timestamp of when the category was created.
updated_at
string
required
ISO 8601 timestamp of the last update.
productos
Producto[]
Array of products belonging to this category. Only populated when fetching by ID.
curl --request GET \
  --url http://localhost:3000/inventario/categorias \
  --header "Authorization: Bearer <access_token>"

POST /inventario/categorias

Creates a new category and returns the saved object. Authentication: Required — Authorization: Bearer <access_token>

Request Body

nombre
string
required
Name of the category. Maximum 100 characters.
id_user_create
number
required
ID of the authenticated user performing the creation. Used for audit tracking.

Response Fields

id
number
required
Auto-generated unique identifier assigned to the new category.
nombre
string
required
Name of the newly created category.
estado
boolean
required
Defaults to true on creation.
id_user_create
number | null
required
Echoes back the user ID that created the record.
created_at
string
required
ISO 8601 timestamp of creation.
updated_at
string
required
ISO 8601 timestamp (equals created_at on initial save).
curl --request POST \
  --url http://localhost:3000/inventario/categorias \
  --header "Authorization: Bearer <access_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "nombre": "Bebidas",
    "id_user_create": 1
  }'

GET /inventario/categorias/:id

Fetches a single category by its numeric ID. The response includes the productos array with all products associated with that category. Authentication: Required — Authorization: Bearer <access_token>

Path Parameters

id
number
required
The unique identifier of the category to retrieve.

Response Fields

id
number
required
Unique identifier of the category.
nombre
string
required
Display name of the category.
estado
boolean
required
Whether the category is active.
productos
Producto[]
Products that belong to this category.
created_at
string
required
ISO 8601 creation timestamp.
updated_at
string
required
ISO 8601 last-update timestamp.
curl --request GET \
  --url http://localhost:3000/inventario/categorias/3 \
  --header "Authorization: Bearer <access_token>"

PATCH /inventario/categorias/:id

Partially updates an existing category. Only the fields you include in the request body are changed; omitted fields retain their current values. Authentication: Required — Authorization: Bearer <access_token>

Path Parameters

id
number
required
The unique identifier of the category to update.

Request Body

nombre
string
New display name for the category. Maximum 100 characters.
id_user_update
number
ID of the authenticated user performing the update. Used for audit tracking.

Response Fields

id
number
required
Unique identifier of the updated category.
nombre
string
required
Updated name of the category.
estado
boolean
required
Active status of the category.
id_user_update
number | null
ID of the user who performed this update.
updated_at
string
required
ISO 8601 timestamp reflecting the time of this update.
curl --request PATCH \
  --url http://localhost:3000/inventario/categorias/3 \
  --header "Authorization: Bearer <access_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "nombre": "Bebidas y Refrescos",
    "id_user_update": 1
  }'

DELETE /inventario/categorias/:id

Deactivates a category by setting its estado field to false. The record is not permanently removed from the database. Authentication: Required — Authorization: Bearer <access_token>
This is a soft delete. The category record is preserved in the database with estado set to false. It will no longer appear in the GET /inventario/categorias list, but historical references from products are maintained for data integrity.

Path Parameters

id
number
required
The unique identifier of the category to deactivate.
curl --request DELETE \
  --url http://localhost:3000/inventario/categorias/3 \
  --header "Authorization: Bearer <access_token>"

Build docs developers (and LLMs) love