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.

The Suppliers resource manages the vendors and providers associated with a sublimation company. A supplier record captures both company-level information (business name, NIT/CC, city) and a contact person’s details. All supplier operations are scoped to a company_id and all fields are required when creating a supplier.
All sublimation supplier 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/supplier/create-supplier-company/:company_id

Creates a new supplier record linked to the given company. All body fields are required — the controller returns 403 if any field is missing. Path parameters
company_id
string
required
The MongoDB ObjectId of the company under which the supplier is registered.
Body parameters
document_type_supplier
string
required
The type of identification document for the supplier. Accepted values: CC, NIT.
number_document_supplier
string
required
The supplier’s identification document number.
company_name
string
required
The supplier’s business name (razón social).
contact_name
string
required
The name of the primary contact person at the supplier.
email_supplier
string
required
The supplier’s email address.
phone_supplier
string
required
The supplier’s phone number.
address_supplier
string
required
The supplier’s physical address.
city_supplier
string
required
The city where the supplier is located.
Responses
msj
string
Returns "Nuevo proveedor creado exitosamente" on success.
status
boolean
true on success, false on failure.
new_create_supplier
object
The newly created supplier document as stored in MongoDB, including the generated _id, all submitted fields, company, and createdAt/updatedAt timestamps.
curl -X POST https://api.example.com/api/supplier/create-supplier-company/64a1f2e3b5c8d90012345678 \
  -H "token-access: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "document_type_supplier": "NIT",
    "number_document_supplier": "830045678-9",
    "company_name": "Insumos Textiles del Norte SAS",
    "contact_name": "Carlos Herrera",
    "email_supplier": "carlos@insumos.com",
    "phone_supplier": "6014567890",
    "address_supplier": "Calle 45 # 12-30",
    "city_supplier": "Bogotá"
  }'
{
  "msj": "Nuevo proveedor creado exitosamente",
  "status": true,
  "new_create_supplier": {
    "_id": "64c3b4d5e7f8a90034567890",
    "company": "64a1f2e3b5c8d90012345678",
    "document_type_supplier": "NIT",
    "number_document_supplier": "830045678-9",
    "company_name": "Insumos Textiles del Norte SAS",
    "contact_name": "Carlos Herrera",
    "email_supplier": "carlos@insumos.com",
    "phone_supplier": "6014567890",
    "address_supplier": "Calle 45 # 12-30",
    "city_supplier": "Bogotá",
    "createdAt": "2024-07-15T11:00:00.000Z",
    "updatedAt": "2024-07-15T11:00:00.000Z"
  }
}

PUT /api/supplier/update-supplier-company/:company_id/:supplier_id

Updates an existing supplier record. Both the company and the supplier are validated before any changes are applied. Path parameters
company_id
string
required
The MongoDB ObjectId of the company that owns the supplier.
supplier_id
string
required
The MongoDB ObjectId of the supplier to update.
Body parameters
document_type_supplier
string
Updated document type. Accepted values: CC, NIT.
number_document_supplier
string
Updated identification document number.
company_name
string
Updated business name.
contact_name
string
Updated contact person name.
email_supplier
string
Updated email address.
phone_supplier
string
Updated phone number.
address_supplier
string
Updated address.
city_supplier
string
Updated city.
Responses
msj
string
Returns "Proveedor actualizado correctamente" on success.
status
boolean
true on success, false on failure.
resp
object
The raw MongoDB updateOne result object containing matchedCount and modifiedCount.
curl -X PUT https://api.example.com/api/supplier/update-supplier-company/64a1f2e3b5c8d90012345678/64c3b4d5e7f8a90034567890 \
  -H "token-access: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "document_type_supplier": "NIT",
    "number_document_supplier": "830045678-9",
    "company_name": "Insumos Textiles del Norte SAS",
    "contact_name": "Ana Martínez",
    "email_supplier": "ana@insumos.com",
    "phone_supplier": "6014567891",
    "address_supplier": "Carrera 10 # 22-50",
    "city_supplier": "Medellín"
  }'
{
  "msj": "Proveedor actualizado correctamente",
  "status": true,
  "resp": {
    "acknowledged": true,
    "matchedCount": 1,
    "modifiedCount": 1
  }
}

GET /api/supplier/list-supplier-company/:company_id

Returns a paginated list of all suppliers belonging to a company. Pagination is driven by the Paginate middleware, which accepts pag and perpage query parameters. Path parameters
company_id
string
required
The MongoDB ObjectId of the company whose suppliers are to be listed.
Pagination Append ?pag=1&perpage=10 as query parameters to control which page of results to retrieve. The Paginate middleware computes skippag and limit and injects them into req.body. The response includes a pagination object. Responses
msj
string
Returns "Cargando proveedores" on success.
status
boolean
true on success.
data
array
Array of supplier documents sorted by _id descending. Each element contains _id, company, document_type_supplier, number_document_supplier, company_name, contact_name, email_supplier, phone_supplier, address_supplier, city_supplier, createdAt, and updatedAt.
pagination
object
Pagination metadata.
curl -X GET "https://api.example.com/api/supplier/list-supplier-company/64a1f2e3b5c8d90012345678?pag=1&perpage=10" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando proveedores",
  "status": true,
  "data": [
    {
      "_id": "64c3b4d5e7f8a90034567890",
      "company": "64a1f2e3b5c8d90012345678",
      "document_type_supplier": "NIT",
      "number_document_supplier": "830045678-9",
      "company_name": "Insumos Textiles del Norte SAS",
      "contact_name": "Ana Martínez",
      "email_supplier": "ana@insumos.com",
      "phone_supplier": "6014567891",
      "address_supplier": "Carrera 10 # 22-50",
      "city_supplier": "Medellín",
      "createdAt": "2024-07-15T11:00:00.000Z",
      "updatedAt": "2024-07-15T12:00:00.000Z"
    }
  ],
  "pagination": {
    "pag": "1",
    "perpage": 10,
    "pags": 1
  }
}

DELETE /api/supplier/delete-supplier-company/:supplier_id

Permanently removes a supplier record. The supplier’s company field is checked against the authenticated user’s identity before deletion proceeds. Path parameters
supplier_id
string
required
The MongoDB ObjectId of the supplier to delete.
Responses
msj
string
Returns "Proveedor eliminado exitosamente" on success.
status
boolean
true on success, false on failure.
curl -X DELETE https://api.example.com/api/supplier/delete-supplier-company/64c3b4d5e7f8a90034567890 \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Proveedor eliminado exitosamente",
  "status": true
}

Build docs developers (and LLMs) love