Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/MultiSas/llms.txt

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

Menu categories are the top-level groupings that organize your restaurant’s products — for example, Starters, Main Dishes, Beverages, and Desserts. Every product must belong to a category, so categories should be created before any menu items are added. The four endpoints below let you create, update, list, and delete categories for a given company tenant.
All category endpoints require two authentication middlewares. TokenAny validates the bearer token and attaches the user to the request. TokenAuthorize('Admin', 'Super Admin') then restricts access to users whose role is either Admin or Super Admin. Include the token in every request as token-access: Bearer $TOKEN.

Create a Category


POST /api/category/:company_id Creates a new menu category scoped to the specified company.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the company (tenant) that owns this category.

Body Parameters

name_category
string
required
Display name for the category (e.g. "Platos Fuertes", "Bebidas").
description_category
string
required
A short description of what the category contains.
sort_order
string
required
A string value used to sort categories on the menu (e.g. "1", "2").

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success, false on failure.
save_category
object
The newly created category document.

Example

curl -X POST https://api.example.com/api/category/64a1f2c3e4b0a1b2c3d4e5f6 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "name_category": "Platos Fuertes",
    "description_category": "Platos principales del menú",
    "sort_order": "1"
  }'
{
  "msj": "Categoria registrada exitosamente",
  "status": true,
  "save_category": {
    "_id": "64b2e3d4f5a6b7c8d9e0f1a2",
    "name_category": "Platos Fuertes",
    "description_category": "Platos principales del menú",
    "sort_order": "1",
    "status_category": true,
    "company": {
      "_id": "64a1f2c3e4b0a1b2c3d4e5f6",
      "name_company": "Restaurante El Sabor",
      "name_founder": "Juan Pérez",
      "nit_company": "900123456-7",
      "type_dato": "restaurante"
    },
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  }
}

Update a Category


PUT /api/category/updating/:company_id/:category_id Updates the name_category, description_category, and sort_order fields of an existing category.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
category_id
string
required
The MongoDB ObjectId of the category to update.

Body Parameters

name_category
string
required
Updated display name for the category.
description_category
string
required
Updated description.
sort_order
string
required
Updated sort order value.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success, false on failure.

Example

curl -X PUT https://api.example.com/api/category/updating/64a1f2c3e4b0a1b2c3d4e5f6/64b2e3d4f5a6b7c8d9e0f1a2 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "name_category": "Entradas",
    "description_category": "Platos de entrada y aperitivos",
    "sort_order": "2"
  }'
{
  "msj": "Categoria actualizada exitosamente",
  "status": true
}

List Categories


GET /api/category/list/:company_id Returns a paginated list of all categories belonging to the specified company, sorted by most recently created.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the company whose categories to retrieve.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success.
data
array
Array of category documents matching the company.
pagination
object
Pagination metadata.

Example

curl -X GET https://api.example.com/api/category/list/64a1f2c3e4b0a1b2c3d4e5f6 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando categorias",
  "status": true,
  "data": [
    {
      "_id": "64b2e3d4f5a6b7c8d9e0f1a2",
      "name_category": "Platos Fuertes",
      "description_category": "Platos principales del menú",
      "sort_order": "1",
      "status_category": true,
      "company": {
        "_id": "64a1f2c3e4b0a1b2c3d4e5f6",
        "name_company": "Restaurante El Sabor",
        "name_founder": "Juan Pérez",
        "nit_company": "900123456-7",
        "type_dato": "restaurante"
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "pag": 0,
    "perpage": 10,
    "pags": 1
  }
}

Delete a Category


DELETE /api/category/delete/:category_id Permanently deletes a category by its ID. This action is irreversible.

Path Parameters

category_id
string
required
The MongoDB ObjectId of the category to delete.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success, false if the category was not found.

Example

curl -X DELETE https://api.example.com/api/category/delete/64b2e3d4f5a6b7c8d9e0f1a2 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Categoria eliminada exitosamente",
  "status": true
}

Build docs developers (and LLMs) love