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.

Orders (pedidos) represent customer requests for sublimation work — a uniform batch, a set of caps, a custom t-shirt run, and so on. When an order is created, the system auto-generates a sequential bill counter (e.g., PD-0001) and sets the initial state to Pendiente. Orders then progress through the states En produccion and Entregado as production and delivery are completed.
All sublimation order endpoints require two middleware layers: TokenAny validates any active bearer token (company or user-company token), and TokenAuthorize('Admin', 'Super Admin') restricts access to users holding the Admin or Super Admin role. Include the token in every request using the token-access: Bearer $TOKEN header.

POST /api/pedido/:company_id/:client_id

Creates a new order for the specified client within the given company. The system records the current date and time automatically and sets state_pedido to Pendiente. All four body fields are required. Path parameters
company_id
string
required
The MongoDB ObjectId of the company placing the order.
client_id
string
required
The MongoDB ObjectId of the client the order belongs to.
Body parameters
description_pedido
string
required
A text description of the order — what is being made, design details, etc.
type_pedido
string
required
The type or category of product being ordered (e.g., Uniforme, Camisa, Gorras, Sudadera).
quantity_pedido
string
required
The quantity of items requested.
price_pedido
string
required
The agreed price for the order.
Responses
msj
string
Returns "Nuevo pedido registrado correctamente" on success.
status
boolean
true on success, false on failure.
save_pedido
object
The saved order document. Includes _id, bill_counter, date_pedido, hour_pedido, description_pedido, type_pedido, quantity_pedido, price_pedido, moneda (default COP), state_pedido, company, client (with _id, name_client, phone_client), createdAt, and updatedAt.
curl -X POST https://api.example.com/api/pedido/64a1f2e3b5c8d90012345678/64b2a3c4d6e7f80023456789 \
  -H "token-access: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "description_pedido": "10 camisetas con logo bordado en el pecho",
    "type_pedido": "Camisa",
    "quantity_pedido": "10",
    "price_pedido": "350000"
  }'
{
  "msj": "Nuevo pedido registrado correctamente",
  "status": true,
  "save_pedido": {
    "_id": "64d4c5e6f8a9b00045678901",
    "bill_counter": "PD-0001",
    "date_pedido": "15/7/2024",
    "hour_pedido": "10:45:30 a. m.",
    "description_pedido": "10 camisetas con logo bordado en el pecho",
    "type_pedido": "Camisa",
    "quantity_pedido": "10",
    "price_pedido": "350000",
    "moneda": "COP",
    "state_pedido": "Pendiente",
    "company": "64a1f2e3b5c8d90012345678",
    "client": {
      "_id": "64b2a3c4d6e7f80023456789",
      "name_client": "Laura Gómez",
      "phone_client": "3001234567"
    },
    "createdAt": "2024-07-15T10:45:30.000Z",
    "updatedAt": "2024-07-15T10:45:30.000Z"
  }
}

PUT /api/pedido/update-state/:company_id/:pedido_id

Updates the state_pedido field of an existing order. Use this endpoint to advance an order through the workflow — from Pendiente to En produccion and finally to Entregado. Path parameters
company_id
string
required
The MongoDB ObjectId of the company that owns the order.
pedido_id
string
required
The MongoDB ObjectId of the order whose state is being updated.
Body parameters
state_pedido
string
required
The new state to apply to the order. Accepted values: Pendiente, En produccion, Entregado.
Responses
msj
string
Returns "Estado del pedido actualizado correctamente" on success.
status
boolean
true on success.
curl -X PUT https://api.example.com/api/pedido/update-state/64a1f2e3b5c8d90012345678/64d4c5e6f8a9b00045678901 \
  -H "token-access: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "state_pedido": "En produccion"
  }'
{
  "msj": "Estado del pedido actualizado correctamente",
  "status": true
}

GET /api/pedido/list/:company_id/:pedido_id/:query/:pag?/:perpage?

Returns a paginated, optionally filtered list of orders. The :query path segment is a numeric filter: 0 returns only Pendiente orders, 1 returns En produccion, 2 returns Entregado, and any other number returns all orders unfiltered. Path parameters
company_id
string
required
The MongoDB ObjectId of the company whose orders are listed.
pedido_id
string
required
A MongoDB ObjectId used to scope the initial document lookup. Pass a valid (or placeholder) ObjectId; the controller queries by this ID and then filters client-side.
query
string
required
Numeric filter string controlling which state_pedido to return:
  • 0Pendiente
  • 1En produccion
  • 2Entregado
  • Any other value → no state filter applied (all orders returned)
pag
string
Optional page number. Defaults to 1 if omitted.
perpage
string
Optional number of results per page. Defaults to the server’s configured default if omitted.
Responses
msj
string
Returns "Cargando informacion de pedidos" on success.
status
boolean
true on success.
data
array
Array of matching order documents for the current page, sorted by _id descending.
pagination
object
Pagination metadata.
curl -X GET "https://api.example.com/api/pedido/list/64a1f2e3b5c8d90012345678/64d4c5e6f8a9b00045678901/0/1/10" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando informacion de pedidos",
  "status": true,
  "data": [
    {
      "_id": "64d4c5e6f8a9b00045678901",
      "bill_counter": "PD-0001",
      "date_pedido": "15/7/2024",
      "hour_pedido": "10:45:30 a. m.",
      "description_pedido": "10 camisetas con logo bordado en el pecho",
      "type_pedido": "Camisa",
      "quantity_pedido": "10",
      "price_pedido": "350000",
      "moneda": "COP",
      "state_pedido": "Pendiente",
      "company": "64a1f2e3b5c8d90012345678",
      "client": {
        "_id": "64b2a3c4d6e7f80023456789",
        "name_client": "Laura Gómez",
        "phone_client": "3001234567"
      }
    }
  ],
  "pagination": {
    "pag": "1",
    "perpage": 10,
    "pags": 1
  }
}

GET /api/pedido/list-data/:company_id/:pedido_id/unique

Retrieves a single order document by its ID within a given company. Path parameters
company_id
string
required
The MongoDB ObjectId of the company that owns the order.
pedido_id
string
required
The MongoDB ObjectId of the specific order to retrieve.
Responses
msj
string
Returns "Cargando informacion de pedido" on success.
status
boolean
true on success.
pedidoX
object
The full order document including _id, bill_counter, date_pedido, hour_pedido, description_pedido, type_pedido, quantity_pedido, price_pedido, moneda, state_pedido, company, client, createdAt, and updatedAt.
curl -X GET https://api.example.com/api/pedido/list-data/64a1f2e3b5c8d90012345678/64d4c5e6f8a9b00045678901/unique \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando informacion de pedido",
  "status": true,
  "pedidoX": {
    "_id": "64d4c5e6f8a9b00045678901",
    "bill_counter": "PD-0001",
    "date_pedido": "15/7/2024",
    "hour_pedido": "10:45:30 a. m.",
    "description_pedido": "10 camisetas con logo bordado en el pecho",
    "type_pedido": "Camisa",
    "quantity_pedido": "10",
    "price_pedido": "350000",
    "moneda": "COP",
    "state_pedido": "Pendiente",
    "company": "64a1f2e3b5c8d90012345678",
    "client": {
      "_id": "64b2a3c4d6e7f80023456789",
      "name_client": "Laura Gómez",
      "phone_client": "3001234567"
    },
    "createdAt": "2024-07-15T10:45:30.000Z",
    "updatedAt": "2024-07-15T10:45:30.000Z"
  }
}

Build docs developers (and LLMs) love