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

List expiring batches

Any signed in user. Returns active batches that expire within the window, soonest first. Recalled and quarantined batches are left out, as one already pulled is not a stock threat.

GET/api/v1/alerts/expiry
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Query parameters
daysinteger

How many days ahead to look. Defaults to 90.

branch_idstring

Look at one branch only. Omitted means every branch.

Responses
200

Batches expiring inside the window

alertsobject[]required
Show properties
Array of object
batch_idstringrequired
medicine_idstringrequired
medicine_namestringrequired
branch_idstringrequired
branch_namestringrequired
batch_numberstringrequired
expiry_datestringrequired
days_to_expiryintegerrequired
min -9007199254740991 · max 9007199254740991
qty_remainingnumberrequired
unit_coststringrequired
countintegerrequired
min -9007199254740991 · max 9007199254740991
401

Not authenticated

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/alerts/expiry' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "alerts": [
    {
      "batch_id": "string",
      "medicine_id": "string",
      "medicine_name": "string",
      "branch_id": "string",
      "branch_name": "string",
      "batch_number": "string",
      "expiry_date": "string",
      "days_to_expiry": -9007199254740991,
      "qty_remaining": 0,
      "unit_cost": "string"
    }
  ],
  "count": -9007199254740991
}