Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

List low stock alerts

Any signed in user. Returns active medicines at or below their threshold, thinnest first. Each row carries the shortfall, so the caller orders against the gap, not recomputing it.

GET/api/v1/alerts/low-stock
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Query parameters
branch_idstring

Count stock for one branch only. Omitted means every branch.

Responses
200

Medicines at or below their threshold

alertsobject[]required
Show properties
Array of object
medicine_idstringrequired
namestringrequired
stock_quantitynumberrequired
low_stock_thresholdnumberrequired
deficitnumberrequired
countintegerrequired
min -9007199254740991 · max 9007199254740991
401

Not authenticated

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/alerts/low-stock' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "alerts": [
    {
      "medicine_id": "string",
      "name": "string",
      "stock_quantity": 0,
      "low_stock_threshold": 0,
      "deficit": 0
    }
  ],
  "count": -9007199254740991
}