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

List expired batches

Admin only. Returns active batches whose expiry date has passed, with stock still on them. The figure runs forward from the expiry date, so the caller sees how long a batch is off sale.

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

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

Query parameters
branch_idstring

Look at one branch only. Omitted means every branch.

Responses
200

Batches that have already expired

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

Not authenticated

detailstringrequired
403

Caller is not an admin

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/alerts/expired' \
  -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_expired": -9007199254740991,
      "qty_remaining": 0,
      "unit_cost": "string"
    }
  ],
  "count": -9007199254740991
}