Pharmacy products represent every item in your dispensary’s inventory — medications, hygiene supplies, medical materials, and more. Each product record tracks its category, cost, sale price, unit of measure, stock levels, minimum stock threshold, and one or more batch (lote) entries that carry per-batch expiry dates and quantities. Eight endpoints cover the full inventory lifecycle: create, update core fields, update a batch, list all products, list low-stock products, list expired batches, delete a batch, and delete a product.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.
All pharmacy product 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 Product
POST /api/product-pharmacy/:company_id
Creates a new pharmacy product. All fields are required. The batch_product array must contain at least one valid batch entry.
Path Parameters
The MongoDB ObjectId of the owning company.
Body Parameters
Name of the product (e.g.
"Ibuprofeno 400mg").Product category. Must be one of:
"analgesicos", "antibioticos", "gastrointestinal", "antialergicos", "diabetes", "cardiovascular", "vitaminas", "higiene", "material medico", "respiratorio".Purchase cost of the product (stored as a string).
Sale price of the product (stored as a string).
Unit of sale. Must be one of:
"unidad", "kg", "gramo", "litro", "metro", "caja", "paquete", "rollo", "".Maximum expected stock quantity.
Minimum stock threshold; products at or below this value appear in the low-stock list.
Array of batch objects. Must contain at least one entry. Each entry must include:
lote(string) — batch identifierexpiration_date(string, ISO 8601 date) — expiry date for this batchquantity(number) — quantity in this batch
Response Fields
Human-readable result message.
true on success, false on failure.The newly created product document.
Example
Update a Product
PATCH /api/product-pharmacy/:company_id/updating/:product_id
Updates the core fields of an existing pharmacy product. Does not update batch entries.
Path Parameters
The MongoDB ObjectId of the owning company.
The MongoDB ObjectId of the product to update.
Body Parameters
Updated product name.
Updated category. Must be a valid enum value (see Create above).
Updated purchase cost.
Updated sale price.
Updated unit of sale. Must be a valid enum value (see Create above).
Updated maximum stock quantity.
Updated minimum stock threshold.
Response Fields
Human-readable result message.
true on success.Example
Update a Product Batch
PUT /api/product-pharmacy/:company_id/company/:product_id/product/:batch_id
Updates a single batch entry inside a product’s batch_product array.
Path Parameters
The MongoDB ObjectId of the owning company.
The MongoDB ObjectId of the product that owns the batch.
The MongoDB ObjectId of the batch subdocument to update.
Body Parameters
Updated batch identifier.
Updated expiry date. Accepted formats:
YYYY-MM-DD (e.g. "2026-12-31").Updated quantity in this batch.
Response Fields
Human-readable result message.
true on success.Example
List Products with Low Stock
GET /api/product-pharmacy/stock/:company_id/:pag?/:perpage?
Returns a paginated list of products whose stock_product is less than or equal to minimum_stock_product.
Path Parameters
The MongoDB ObjectId of the company.
Optional page number.
Optional results per page.
Response Fields
Human-readable result message.
true on success.Products at or below their minimum stock level.
Pagination metadata with
pag, perpage, and pags.Example
List Products with Expired Batches
GET /api/product-pharmacy/lotes/:company_id/:pag?/:perpage?
Returns a paginated list of products that contain at least one batch whose expiration_date is in the past.
Path Parameters
The MongoDB ObjectId of the company.
Optional page number.
Optional results per page.
Response Fields
Human-readable result message.
true on success.Products with at least one expired batch.
Pagination metadata with
pag, perpage, and pags.Example
List All Products
GET /api/product-pharmacy/:company_id/:pag?/:perpage?
Returns a paginated list of all pharmacy products for the specified company, sorted by most recently created.
Path Parameters
The MongoDB ObjectId of the company.
Optional page number.
Optional results per page.
Response Fields
Human-readable result message.
true on success.Array of all pharmacy product documents for the company.
Pagination metadata with
pag, perpage, and pags.Example
Delete a Product Batch
DELETE /api/product-pharmacy/remove/:company_id/-/:product_id/-/:batch_id
Removes a single batch from a product’s batch_product array without deleting the product.
Path Parameters
The MongoDB ObjectId of the owning company.
The MongoDB ObjectId of the product.
The MongoDB ObjectId of the batch subdocument to remove.
Response Fields
Human-readable result message.
true on success.Example
Delete a Product
DELETE /api/product-pharmacy/:company_id/-/:product_id
Permanently removes a pharmacy product and all its batch data.
Path Parameters
The MongoDB ObjectId of the owning company.
The MongoDB ObjectId of the product to delete.
Response Fields
Human-readable result message.
true on success.