temetro

Inventory

The pharmacy's medication stock.

The clinic's pharmacy stock — what medications are held, how much, and where. Searchable from the Pharmacy → Inventory page.

MethodPathPermission
GET/api/inventoryinventory:read
POST/api/inventoryinventory:write
PUT/api/inventory/{id}inventory:write
DELETE/api/inventory/{id}inventory:delete

Pharmacy holds inventory:read / inventory:write (not delete); full clinicians (owner / admin / doctor / member) hold all three. Reception and Lab have no access.

The inventory object

FieldTypeNotes
idstringAssigned by the server
namestringRequired. Medication name
formstringe.g. "Tablet", "Capsule", "Injection"
strengthstringe.g. "500 mg"
unitstringStock unit, e.g. "tablets", "vials"
stockQuantitynumberWhole units on hand; defaults to 0
reorderThresholdnumberLow-stock trigger; defaults to 0
locationstringShelf / bin label
expiresAtstring | nullYYYY-MM-DD
notesstring | nullFree text

Availability (in-stock / low / out) is derived on the client, not stored: out when stockQuantity is 0, low when it's at or below reorderThreshold, otherwise in-stock.

Example

curl -b cookies.txt -X POST http://localhost:4000/api/inventory \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Amoxicillin",
    "form": "Capsule",
    "strength": "500 mg",
    "unit": "capsules",
    "stockQuantity": 90,
    "reorderThreshold": 100,
    "location": "B1"
  }'

Create returns 201 with the item; PUT updates with the same payload shape; DELETE returns 204. Writes appear in the activity log.

On this page