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

Report on the medicine inventory

Admin, branch manager, or auditor. Returns totals, value, categories, and a low stock list. A branch_id scopes every figure to that branch; without one the org-wide stock is reported.

GET/api/v1/reports/inventory
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Query parameters
branch_idstring

Scope the report to one branch. Empty reports every branch together.

Responses
200

The inventory report

total_medicinesintegerrequired
min -9007199254740991 · max 9007199254740991
low_stock_countintegerrequired
min -9007199254740991 · max 9007199254740991
inventory_valuestringrequired
by_categoryobject[]required
Show properties
Array of object
categorystringrequired
medicine_countintegerrequired
min -9007199254740991 · max 9007199254740991
total_unitsintegerrequired
min -9007199254740991 · max 9007199254740991
total_valuestringrequired
low_stock_listobject[]required
Show properties
Array of object
idstringrequired
namestringrequired
categorystringrequired
stock_quantityintegerrequired
min -9007199254740991 · max 9007199254740991
low_stock_thresholdintegerrequired
min -9007199254740991 · max 9007199254740991
selling_pricestringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin, branch manager, or auditor

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/reports/inventory' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "total_medicines": -9007199254740991,
  "low_stock_count": -9007199254740991,
  "inventory_value": "string",
  "by_category": [
    {
      "category": "string",
      "medicine_count": -9007199254740991,
      "total_units": -9007199254740991,
      "total_value": "string"
    }
  ],
  "low_stock_list": [
    {
      "id": "string",
      "name": "string",
      "category": "string",
      "stock_quantity": -9007199254740991,
      "low_stock_threshold": -9007199254740991,
      "selling_price": "string"
    }
  ]
}