The briefcase module manages invoices and accounts receivable (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.
cartera). An invoice ties together an order (pedido) and a client, records total and balance amounts, and tracks payment history. Use these endpoints to generate client-facing invoices and log payments against them — the invoice balance decrements with each recorded payment and the status updates automatically.
All briefcase endpoints require
TokenAny plus TokenAuthorize('Admin', 'Super Admin'). Pass your token using token-access: Bearer $TOKEN.POST /api/briefcase/invoice/:company_id/:pedido_id/:client_id
Creates an invoice (factura) linked to a specific order and client. The total and balance are derived from pedido.price_pedido; the total body field is accepted but the controller reads the price directly from the pedido record.
Path parameters
MongoDB ObjectId of the company issuing the invoice.
MongoDB ObjectId of the order being invoiced.
MongoDB ObjectId of the client receiving the invoice.
Invoice issue date (ISO 8601 date string, e.g.,
"2024-08-15").Invoice payment due date (ISO 8601 date string, e.g.,
"2024-09-15").Whether this invoice is issued on credit (
true) or collected immediately (false). Defaults to false."Factura generada exitosamente" on success.true on success.The created invoice document.
POST /api/briefcase/record/:company_id/payments/:invoice_id
Records a payment against an existing invoice. The invoice’sbalance is decremented by amount. If balance reaches zero or below, status is set to "Pagado". If the balance remains positive but the current date exceeds due_date, status is set to "Atrasado".
Path parameters
MongoDB ObjectId of the company.
MongoDB ObjectId of the invoice to record a payment against.
Payment amount being applied to the invoice balance.
Payment method (e.g.,
Efectivo, Transferencia, Tarjeta de credito)."Pago registrado exitosamente" on success.true on success.The created payment record with
company, invoice, client, amount, and method.The updated invoice document reflecting the new
balance and status.GET /api/briefcase/:company_id
Returns a paginated list of all invoices for a company, sorted by most recent first. Pagination is handled by thePaginate middleware; pass pag and perpage as query parameters.
Path parameters
MongoDB ObjectId of the company.
"Cargando cartera" on success.true on success.Array of invoice documents for the current page, sorted by
_id descending. Each document contains _id, company, client, pedido, total, balance, status, issue_date, due_date, is_credit, createdAt, and updatedAt.Invoice Status Reference
| Status | Description |
|---|---|
Pendiente | Invoice issued but not yet fully paid |
Pagado | Invoice fully paid (balance reached zero) |
Atrasado | Balance remains but due date has passed |