List purchase orders
hub_get_purchase_ordersStock the merchant has ordered from suppliers — the same list as Purchasing → Purchase Orders, and THE tool for any purchasing question over a period: 'what did I spend on stock last month', 'what is still on order', 'what have I ordered from this supplier', 'what is arriving this week'. Filter by status, supplier, outlet and a created-date range. READ totalCost CAREFULLY: it is what the order was placed FOR, not what was paid, and it sits on suggested and draft rows too — summing the whole list answers 'what have I proposed', not 'what did I spend'. For spend, filter status to ['sent','partially_received','fully_received']; for what a delivery actually cost, read the receipts block of get_purchase_order. Statuses, in order: suggested (auto-proposed by a reorder rule, not ordered), draft (being written), sent (with the supplier), partially_received (some arrived), fully_received (all in). "Open" means anything not fully_received. Cancelled orders are gone from this list entirely. The date range filters on when the order was CREATED, not when it was sent or received. Costs here are what the merchant pays suppliers — for sales and revenue use the report tools instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 1-based page, default 1 | |
| search | No | Match the PO number | |
| sortBy | No | Default createdAt | |
| status | No | Keep only these statuses | |
| endDate | No | ISO date — orders created up to and including this day | |
| pageSize | No | Rows per page, default 20 | |
| outletIds | No | Outlet ids from get_outlets | |
| sortOrder | No | Default desc | |
| startDate | No | ISO date — orders created on or after this day | |
| supplierIds | No | Supplier ids from get_suppliers |