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.

Delivery records capture off-premises orders — orders where a product is dispatched to a customer’s address rather than served at a table. Each delivery stores client contact information, a delivery address, optional reference notes, and tracks its current status (in transit, delivered, or not delivered) and payment method. Four endpoints cover the full lifecycle: create, update status, update payment method, and list deliveries with optional status filtering.
All delivery 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 Delivery


POST /api/delivery/:company_id/:product_id Creates a new delivery record. The product referenced by :product_id is looked up and its data is embedded as a snapshot.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
product_id
string
required
The MongoDB ObjectId of the product being delivered.

Body Parameters

name_client_delivery
string
required
Full name of the customer receiving the delivery.
phone_client_delivery
string
required
Contact phone number of the customer.
address_client_delivery
string
required
Delivery address for the customer.
references_client_delivery
string
Optional landmark or additional directions to help locate the address (defaults to an empty string).

Response Fields

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

Example

curl -X POST https://api.example.com/api/delivery/64a1f2c3e4b0a1b2c3d4e5f6/64c3f4e5a6b7c8d9e0f1a2b3 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "name_client_delivery": "María López",
    "phone_client_delivery": "3001234567",
    "address_client_delivery": "Calle 45 # 12-34, Apto 301",
    "references_client_delivery": "Edificio azul, portería principal"
  }'
{
  "msj": "Nuevo domicilio creado exitosamente",
  "status": true,
  "save_delivery": {
    "_id": "64f6a7b8c9d0e1f2a3b4c5d6",
    "name_client_delivery": "María López",
    "phone_client_delivery": "3001234567",
    "address_client_delivery": "Calle 45 # 12-34, Apto 301",
    "references_client_delivery": "Edificio azul, portería principal",
    "status_delivery": "",
    "payment_method": "",
    "paid": false,
    "product": {
      "_id": "64c3f4e5a6b7c8d9e0f1a2b3",
      "name_product": "Bandeja Paisa",
      "price_product": "28000",
      "extras": []
    },
    "createdAt": "2024-01-15T18:00:00.000Z",
    "updatedAt": "2024-01-15T18:00:00.000Z"
  }
}

Update Delivery Status


PUT /api/delivery/status/:company_id/:delivery_id Updates the status_delivery field of an existing delivery record.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
delivery_id
string
required
The MongoDB ObjectId of the delivery record to update.

Body Parameters

status_delivery
string
required
New delivery status. Must be one of: "En camino", "Entregado", "No entregado", or "".

Response Fields

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

Example

curl -X PUT https://api.example.com/api/delivery/status/64a1f2c3e4b0a1b2c3d4e5f6/64f6a7b8c9d0e1f2a3b4c5d6 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "status_delivery": "En camino"
  }'
{
  "msj": "Estado de domicilio actualizado exitosamente",
  "status": true
}

Update Delivery Payment Method


PUT /api/delivery/update/:company_id/methods/:delivery_id Updates the payment_method and paid fields of a delivery record to record how and whether the customer has paid.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
delivery_id
string
required
The MongoDB ObjectId of the delivery record to update.

Body Parameters

payment_method
string
required
Payment method used. Must be one of: "Efectivo", "Transferencia", or "".
paid
boolean
required
true once payment has been received, false if still pending.

Response Fields

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

Example

curl -X PUT https://api.example.com/api/delivery/update/64a1f2c3e4b0a1b2c3d4e5f6/methods/64f6a7b8c9d0e1f2a3b4c5d6 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "payment_method": "Efectivo",
    "paid": true
  }'
{
  "msj": "Domicilio pagado exitosamente",
  "status": true
}

List Deliveries


GET /api/delivery/list/:company_id/:delivery_id/:query Returns a paginated, optionally filtered list of deliveries. The :query path parameter is a numeric filter: 0 for En camino, 1 for Entregado, 2 for No entregado, and any other value returns all deliveries unfiltered.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
delivery_id
string
required
The MongoDB ObjectId used to scope the delivery lookup.
query
string
required
Numeric string filter: "0" = En camino, "1" = Entregado, "2" = No entregado. Any other value returns all records.

Response Fields

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

Example

curl -X GET https://api.example.com/api/delivery/list/64a1f2c3e4b0a1b2c3d4e5f6/64f6a7b8c9d0e1f2a3b4c5d6/0 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando informacion de domicilios",
  "status": true,
  "data": [
    {
      "_id": "64f6a7b8c9d0e1f2a3b4c5d6",
      "name_client_delivery": "María López",
      "phone_client_delivery": "3001234567",
      "address_client_delivery": "Calle 45 # 12-34, Apto 301",
      "references_client_delivery": "Edificio azul, portería principal",
      "status_delivery": "En camino",
      "payment_method": "Efectivo",
      "paid": false,
      "product": {
        "_id": "64c3f4e5a6b7c8d9e0f1a2b3",
        "name_product": "Bandeja Paisa",
        "price_product": "28000",
        "extras": []
      },
      "createdAt": "2024-01-15T18:00:00.000Z",
      "updatedAt": "2024-01-15T18:05:00.000Z"
    }
  ],
  "pagination": {
    "pag": 0,
    "perpage": 10,
    "pags": 1
  }
}

Build docs developers (and LLMs) love