A pharmacy sale records a product purchase transaction. When a sale is created, the API looks up the company and product, optionally links a registered client, calculatesDocumentation 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.
sub_total and total from the product price multiplied by the requested quantity, auto-generates a bill_counter, and snapshots the product’s batch data at the time of purchase. Two endpoints are available: create a sale and list all sales for a company with pagination.
All sale 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 Sale
POST /api/sale-pharmacy/:company_id/sale/:product_id
Records a new pharmacy sale. quantity must be greater than zero. A client_id is optional — if provided, the client document is looked up and a snapshot is embedded in the sale record.
Path Parameters
The MongoDB ObjectId of the owning company.
The MongoDB ObjectId of the product being sold.
Body Parameters
Number of units being purchased. Must be greater than
0.Payment method for the sale. Must be one of:
"Efectivo", "Tarjeta", "Transferencia". Defaults to "Efectivo".Optional MongoDB ObjectId of a registered pharmacy client to associate with this sale.
Response Fields
Human-readable result message.
true on success, false on failure.The newly created sale document.
Example
List Sales
GET /api/sale-pharmacy/:company_id
Returns a paginated list of all pharmacy sales for the specified company, sorted by most recently created.
Path Parameters
The MongoDB ObjectId of the company whose sales to retrieve.
Response Fields
Human-readable result message.
true on success.Array of sale documents for the company.
Pagination metadata.