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

List purchase orders

Admin, branch manager, or auditor. Returns the hundred newest orders with their item counts. The filters cover branch, supplier, and status, and an unfiltered call spans every branch.

GET/api/v1/purchase-orders
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Query parameters
branch_idstring

Restrict to one branch.

supplier_idstring

Restrict to one supplier.

statusstring

DRAFT, SENT, RECEIVED, or CANCELLED. Empty covers every status.

Responses
200

The recent purchase orders

itemsobject[]required
Show properties
Array of object
idstringrequired
supplier_idstringrequired
branch_idstringrequired
statusstringrequired
expected_datestring | nullrequired
notesstringrequired
created_bystringrequired
created_atstringrequired
updated_atstringrequired
supplier_namestringrequired
branch_namestringrequired
created_by_namestringrequired
item_countinteger
min -9007199254740991 · max 9007199254740991
totalintegerrequired
min -9007199254740991 · max 9007199254740991
401

Not authenticated

detailstringrequired
403

Access forbidden for this role

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/purchase-orders' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "items": [
    {
      "id": "string",
      "supplier_id": "string",
      "branch_id": "string",
      "status": "string",
      "expected_date": "string",
      "notes": "string",
      "created_by": "string",
      "created_at": "string",
      "updated_at": "string",
      "supplier_name": "string",
      "branch_name": "string",
      "created_by_name": "string",
      "item_count": -9007199254740991
    }
  ],
  "total": -9007199254740991
}