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.

Sales in the sublimation module represent the final billing step — converting a completed production into an invoice. Each sale references the associated production and client, auto-generates a sequential bill number, and captures payment method and totals.
All sublimation sales endpoints require TokenAny plus TokenAuthorize('Admin', 'Super Admin'). Include your token in every request using token-access: Bearer $TOKEN.

POST /api/sale/create-sale/:company_id/:production_id

Generates a sale invoice from a finalized production. The production’s price is used as the sale price. The client must be specified in the request body as a MongoDB ObjectId string. Path parameters
company_id
string
required
MongoDB ObjectId of the company.
production_id
string
required
MongoDB ObjectId of the finalized production to invoice.
Body parameters
client
string
required
MongoDB ObjectId string of the client purchasing the production.
payment_method
string
required
Payment method. Accepted values: Tarjeta de credito, Transferencia, Efectivo.
quantity
number
required
Quantity purchased. Must be greater than 0.
Response
msj
string
"Venta realizada correctamente" on success.
status
boolean
true on success.
save_sale
object
The created sale document.
curl -X POST https://api.example.com/api/sale/create-sale/64a1f2e3b5c8d90012345678/64e5d6f7a8b9c00056789012 \
  -H "token-access: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client": "64b2a3c4d6e7f80023456789",
    "payment_method": "Efectivo",
    "quantity": 10
  }'
{
  "msj": "Venta realizada correctamente",
  "status": true,
  "save_sale": {
    "_id": "64f7e8f9a0b1c00278901234",
    "bill_number": "FV-0001",
    "date_sale": "15/8/2024",
    "client": {
      "_id": "64b2a3c4d6e7f80023456789",
      "name_client": "Laura Gómez"
    },
    "payment_method": "Efectivo",
    "production": {
      "_id": "64e5d6f7a8b9c00056789012",
      "bill_counter": "PR-0001",
      "price_production": 350000,
      "type_production": "Camisa",
      "quantity_production": "10"
    },
    "company": "64a1f2e3b5c8d90012345678",
    "quantity": 10,
    "state": "Pagado",
    "price": 350000,
    "sub_total": 350000,
    "total": 350000
  }
}

GET /api/sale/list-sale/:company_id

Returns a paginated list of all sales for a company, sorted by most recent first. Pagination is handled by the Paginate middleware; pass pag and perpage as query parameters. Path parameters
company_id
string
required
MongoDB ObjectId of the company.
Response
msj
string
"Cargando ventas" on success.
status
boolean
true on success.
data
array
Array of sale documents for the current page, sorted by _id descending.
pagination
object
curl -X GET "https://api.example.com/api/sale/list-sale/64a1f2e3b5c8d90012345678?pag=1&perpage=10" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando ventas",
  "status": true,
  "data": [
    {
      "_id": "64f7e8f9a0b1c00278901234",
      "bill_number": "FV-0001",
      "client": {
        "_id": "64b2a3c4d6e7f80023456789",
        "name_client": "Laura Gómez"
      },
      "payment_method": "Efectivo",
      "company": "64a1f2e3b5c8d90012345678",
      "quantity": 10,
      "state": "Pagado",
      "total": 350000
    }
  ],
  "pagination": {
    "pag": "1",
    "perpage": 10,
    "pags": 1
  }
}

GET /api/sale/list/:company_id/unique/:sale_id

Retrieves a single sale by ID within a company. Path parameters
company_id
string
required
MongoDB ObjectId of the company.
sale_id
string
required
MongoDB ObjectId of the sale to retrieve.
Response
msj
string
"Mostrando venta detallada" on success.
status
boolean
true on success.
info_company_sale
object
The full sale document.
curl -X GET https://api.example.com/api/sale/list/64a1f2e3b5c8d90012345678/unique/64f7e8f9a0b1c00278901234 \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Mostrando venta detallada",
  "status": true,
  "info_company_sale": {
    "_id": "64f7e8f9a0b1c00278901234",
    "bill_number": "FV-0001",
    "date_sale": "15/8/2024",
    "client": {
      "_id": "64b2a3c4d6e7f80023456789",
      "name_client": "Laura Gómez"
    },
    "payment_method": "Efectivo",
    "company": "64a1f2e3b5c8d90012345678",
    "quantity": 10,
    "state": "Pagado",
    "price": 350000,
    "sub_total": 350000,
    "total": 350000
  }
}

Build docs developers (and LLMs) love