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

List the medicine catalogue

Any signed in user. Returns a page of the catalogue with a live stock quantity on every row. Search, category, and form narrow the rows, and low_stock keeps rows at or below threshold.

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

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

Query parameters
searchstring

Free text matched against name, barcode, generic name, strength, and form.

categorystring

Restrict to one category slug.

formstring

Restrict to one dose form, or all for every form.

low_stockboolean

Keep only rows at or below their low stock threshold. Matched as the literal true.

is_activestring

true, false, or all. Defaults to true.

branch_idstring

Sum stock for one branch. An empty value sums the whole organisation.

pageinteger

One based page number. Defaults to 1.

page_sizeinteger

Rows per page, capped at 200. Defaults to 20.

Responses
200

A page of medicines

totalintegerrequired
min -9007199254740991 · max 9007199254740991
pageintegerrequired
min -9007199254740991 · max 9007199254740991
page_sizeintegerrequired
min -9007199254740991 · max 9007199254740991
itemsobject[]required
Show properties
Array of object
idstringrequired
namestringrequired
generic_namestringrequired
barcodestringrequired
categorystringrequired
formstringrequired
strengthstringrequired
unitstringrequired
selling_pricestringrequired
max_public_pricestringrequired
stock_quantityintegerrequired
min -9007199254740991 · max 9007199254740991
low_stock_thresholdintegerrequired
min -9007199254740991 · max 9007199254740991
requires_prescriptionbooleanrequired
is_controlledbooleanrequired
vat_categorystringrequired
requires_cold_chainbooleanrequired
sfda_registration_nostringrequired
image_keystringrequired
image_urlstringrequired
is_activebooleanrequired
created_atstringrequired
updated_atstringrequired
401

Not authenticated

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/medicines' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "total": -9007199254740991,
  "page": -9007199254740991,
  "page_size": -9007199254740991,
  "items": [
    {
      "id": "string",
      "name": "string",
      "generic_name": "string",
      "barcode": "string",
      "category": "string",
      "form": "string",
      "strength": "string",
      "unit": "string",
      "selling_price": "string",
      "max_public_price": "string",
      "stock_quantity": -9007199254740991,
      "low_stock_threshold": -9007199254740991,
      "requires_prescription": true,
      "is_controlled": true,
      "vat_category": "string",
      "requires_cold_chain": true,
      "sfda_registration_no": "string",
      "image_key": "string",
      "image_url": "string",
      "is_active": true,
      "created_at": "string",
      "updated_at": "string"
    }
  ]
}