List purchase orders
Stock bought from suppliers. A purchase order carries what a purchase has and a stock transfer does not: a supplier, a unit cost per line and an expected arrival date.
Ordered units never count toward availability. Nothing here changes
count_on_hand until receive runs, because a merchant who has
ordered stock does not have it.
Statuses are draft, ordered, partially_received, received, over_received and
canceled. Each move between them is its own endpoint, not a PATCH
that writes status.
Filter with Ransack predicates such as q[status_eq],
q[supplier_id_eq] or q[expected_at_lteq]. Expand items,
supplier and destination_location.
Required scope: read_purchasing (for API-key authentication).
Filters
Filter withq[<attribute>_<predicate>]=value, for example q[number_cont]=…. Send a list as q[<attribute>_in][]=a&q[<attribute>_in][]=b. How filters work.
Filters through associations
Filters through associations
q[destination_location_id_eq]. The same predicates apply.cancel_by, closed_short_at, created_at, currency, destination_location_id, expected_at, id, number, ordered_at, received_at, reference, status, supplier_id, updated_at. Prefix a field with - to sort descending.Authorizations
Secret API key for admin access
JWT token for admin user authentication
Headers
Bearer token for admin authentication
Query Parameters
Matches any of number and reference (partial, case-insensitive).
Set to true to apply closed.
Set to true to apply open.
Set to true to apply overdue.
Set to true to apply past_cancel_by.
Page number
Number of records per page
Attribute filters, as q[<attribute>_<predicate>]=value. See Filters above for the list.
Comma-separated associations to embed: items, supplier, destination_location

