List purchase orders
Returns a paginated list of purchase orders for the company. This endpoint provides comprehensive filtering, sorting, and pagination capabilities to help you query purchase order history effectively.
Key Features
- Pagination: Control result size with _start and _end parameters (default: 25 items)
- Sorting: Sort by any field in ascending or descending order
- Filtering: Apply complex filters on multiple fields including amounts, types, statuses, and dates
- Relationships: Automatically includes related entities (business partners, items, payables)
Authorization
- Regular users can only view purchase orders from companies they are members of.
- Admin users can view all purchase orders.
Response Structure
The response includes the purchase order details along with nested relationships:
- business_partner: Complete vendor/supplier information
- items: List of purchase order items with approval status and linked invoices
- payables: Related fiscal invoices (when items are linked)
- type: The specific purchase order type (AgainstInvoice, ByMilestone, or ByPercentage)
Purchase Order Types
- AgainstInvoice: Single invoice purchase order (exactly 1 item at 100%)
- ByMilestone: Multiple named deliverables with percentages (e.g., Design 30%, Development 70%)
- ByPercentage: Multiple payment stages with percentages (e.g., 30% advance, 70% final)
Common Use Cases
- Get recent purchase orders: Use default pagination without filters
- Find high-value orders: Filter by amount range
- Check approval status: Filter by item review status
- Audit trail: Sort by created_at or updated_at with date filters
- Vendor reconciliation: Filter by business_partner_id
- Budget tracking: Filter by type and sum amounts
Query parameters
Filter by purchase order type. Supports JSON operators:
- Single type: "Erp::Payouts::PurchaseOrders::AgainstInvoice"
- Multiple types: {"$in": ["Erp::Payouts::PurchaseOrders::ByMilestone", "Erp::Payouts::PurchaseOrders::ByPercentage"]}
Available types:
- Erp::Payouts::PurchaseOrders::AgainstInvoice: Single invoice PO (1 item at 100%)
- Erp::Payouts::PurchaseOrders::ByMilestone: Named deliverables with percentages
- Erp::Payouts::PurchaseOrders::ByPercentage: Payment stages with percentages
Filter purchase orders by vendor/supplier ID
Filter by purchase order folio. The folio is a per-company sequential integer (not a formatted string). Supports:
- Exact match: 1
- Multiple folios: {"$in": [1, 2]}
- Range: {"$gte": 10, "$lte": 20}
Filter by creation date using JSON operators:
- After date: {"$gte": "2025-01-01T00:00:00Z"}
- Before date: {"$lt": "2025-02-01T00:00:00Z"}
- Date range: {"$gte": "2025-01-01T00:00:00Z", "$lt": "2025-02-01T00:00:00Z"}
Filter by last update date. Same operators as created_at.
Filter by purchase order description. Supports:
- Exact match: "Office equipment purchase"
- Partial match: {"$like": "%equipment%"}
- Case insensitive: {"$ilike": "%EQUIPMENT%"}
Filter by currency
Filter by the purchase order's lifecycle/approval state. Supports:
- Single value: "approved"
- Multiple values: {"$in": ["pending", "approved"]}
Parameters
Response
Successfully retrieved purchase orders list
Changes
No recorded changes to this endpoint across all 1 revision of this API.