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.

Products represent the individual items on your restaurant’s menu — dishes, drinks, desserts, or any other offering. Each product belongs to a category and can carry optional extras (add-ons or upsells with their own prices). The endpoints below cover the full lifecycle: create, update, push extras, update extras, delete extras, delete a product, and list all products for a company.
All product endpoints require two authentication middlewares. TokenAny validates the bearer token and attaches the user to the request. TokenAuthorize('Admin', 'Super Admin') 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 Product


POST /api/product/:company_id/:category_id Creates a new menu item under the specified company and category.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
category_id
string
required
The MongoDB ObjectId of the category this product belongs to.

Body Parameters

name_product
string
required
Display name of the menu item (e.g. "Bandeja Paisa").
description_product
string
required
A short description of the menu item.
price_product
string
required
Sale price of the product (stored as a string to preserve formatting).
extras
array
Optional array of add-on items, each with name_extra and price_extra.

Response Fields

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

Example

curl -X POST https://api.example.com/api/product/64a1f2c3e4b0a1b2c3d4e5f6/64b2e3d4f5a6b7c8d9e0f1a2 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "name_product": "Bandeja Paisa",
    "description_product": "Plato típico colombiano con frijoles, arroz y chicharrón",
    "price_product": "28000",
    "extras": [
      { "name_extra": "Aguacate", "price_extra": "2000" }
    ]
  }'
{
  "msj": "Producto creado correctamente",
  "status": true,
  "save_product": {
    "_id": "64c3f4e5a6b7c8d9e0f1a2b3",
    "name_product": "Bandeja Paisa",
    "description_product": "Plato típico colombiano con frijoles, arroz y chicharrón",
    "price_product": "28000",
    "status_product": true,
    "extras": [
      { "_id": "64c3f4e5a6b7c8d9e0f1a2b4", "name_extra": "Aguacate", "price_extra": "2000" }
    ],
    "company": {
      "_id": "64a1f2c3e4b0a1b2c3d4e5f6",
      "name_company": "Restaurante El Sabor",
      "name_founder": "Juan Pérez",
      "nit_company": "900123456-7",
      "type_dato": "restaurante"
    },
    "category": {
      "_id": "64b2e3d4f5a6b7c8d9e0f1a2",
      "name_category": "Platos Fuertes",
      "description_category": "Platos principales del menú",
      "sort_order": "1",
      "status_category": true
    },
    "createdAt": "2024-01-15T11:00:00.000Z",
    "updatedAt": "2024-01-15T11:00:00.000Z"
  }
}

Update a Product


PUT /api/product/:company_id/updating/:product_id Updates core fields of an existing menu product.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
product_id
string
required
The MongoDB ObjectId of the product to update.

Body Parameters

name_product
string
required
Updated name of the product.
description_product
string
required
Updated description.
price_product
string
required
Updated sale price.
status_product
boolean
required
Set to false to deactivate the product from the menu.

Response Fields

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

Example

curl -X PUT https://api.example.com/api/product/64a1f2c3e4b0a1b2c3d4e5f6/updating/64c3f4e5a6b7c8d9e0f1a2b3 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "name_product": "Bandeja Paisa Especial",
    "description_product": "Versión especial con chorizo incluido",
    "price_product": "32000",
    "status_product": true
  }'
{
  "msj": "Producto actualizado exitosamente",
  "status": true
}

Add an Extra to a Product


PUT /api/product/agregate/:company_id_resp/extra/:product_id_resp/push Appends a new extra (add-on) to a product’s extras array.

Path Parameters

company_id_resp
string
required
The MongoDB ObjectId of the owning company.
product_id_resp
string
required
The MongoDB ObjectId of the product to update.

Body Parameters

name_extra
string
required
Name of the extra item (e.g. "Salsa especial").
price_extra
string
required
Price of the extra item (stored as a string).

Response Fields

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

Example

curl -X PUT https://api.example.com/api/product/agregate/64a1f2c3e4b0a1b2c3d4e5f6/extra/64c3f4e5a6b7c8d9e0f1a2b3/push \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "name_extra": "Salsa especial",
    "price_extra": "1500"
  }'
{
  "msj": "Extra agregado exitosamente al producto",
  "status": true
}

Update a Product Extra


PUT /api/product/updating/:company_id/:product_id/:extra_id/product Updates the name_extra and price_extra of a specific item inside the product’s extras array.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
product_id
string
required
The MongoDB ObjectId of the product that owns the extra.
extra_id
string
required
The MongoDB ObjectId of the extra subdocument to update.

Body Parameters

name_extra
string
required
Updated name for the extra.
price_extra
string
required
Updated price for the extra.

Response Fields

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

Example

curl -X PUT https://api.example.com/api/product/updating/64a1f2c3e4b0a1b2c3d4e5f6/64c3f4e5a6b7c8d9e0f1a2b3/64c3f4e5a6b7c8d9e0f1a2b4/product \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "name_extra": "Aguacate extra",
    "price_extra": "2500"
  }'
{
  "msj": "Extra actualizado correctamente",
  "status": true
}

Delete a Product


DELETE /api/product/delete/:company_id/product/:product_id Permanently removes a menu product and all its extras.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
product_id
string
required
The MongoDB ObjectId of the product to delete.

Response Fields

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

Example

curl -X DELETE https://api.example.com/api/product/delete/64a1f2c3e4b0a1b2c3d4e5f6/product/64c3f4e5a6b7c8d9e0f1a2b3 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Producto eliminado exitosamente",
  "status": true
}

Delete a Product Extra


DELETE /api/product/delete/:company_id/product/:product_id/extra/:extra_id Removes a single extra from a product’s extras array without deleting the product itself.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
product_id
string
required
The MongoDB ObjectId of the product.
extra_id
string
required
The MongoDB ObjectId of the extra subdocument to remove.

Response Fields

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

Example

curl -X DELETE https://api.example.com/api/product/delete/64a1f2c3e4b0a1b2c3d4e5f6/product/64c3f4e5a6b7c8d9e0f1a2b3/extra/64c3f4e5a6b7c8d9e0f1a2b4 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Extra eliminado de producto",
  "status": true
}

List Products


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

Path Parameters

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

Response Fields

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

Example

curl -X GET https://api.example.com/api/product/list/64a1f2c3e4b0a1b2c3d4e5f6/product \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando productos",
  "status": true,
  "data": [
    {
      "_id": "64c3f4e5a6b7c8d9e0f1a2b3",
      "name_product": "Bandeja Paisa",
      "description_product": "Plato típico colombiano",
      "price_product": "28000",
      "status_product": true,
      "extras": [
        { "_id": "64c3f4e5a6b7c8d9e0f1a2b4", "name_extra": "Aguacate", "price_extra": "2000" }
      ],
      "company": {
        "_id": "64a1f2c3e4b0a1b2c3d4e5f6",
        "name_company": "Restaurante El Sabor",
        "name_founder": "Juan Pérez",
        "nit_company": "900123456-7",
        "type_dato": "restaurante"
      },
      "category": {
        "_id": "64b2e3d4f5a6b7c8d9e0f1a2",
        "name_category": "Platos Fuertes",
        "description_category": "Platos principales del menú",
        "sort_order": "1",
        "status_category": true
      },
      "createdAt": "2024-01-15T11:00:00.000Z",
      "updatedAt": "2024-01-15T11:00:00.000Z"
    }
  ],
  "pagination": {
    "pag": "1",
    "perpage": 10,
    "pags": 1
  }
}

Build docs developers (and LLMs) love