Skip to main content

List Awaiting-Invoice POs

GET 

/api/purchase-orders/awaiting-invoices

Paginated worklist of purchase orders still awaiting the supplier's invoice — invoice_status in (uninvoiced, partially_invoiced) AND submission_status in (submitted, finalized), not archived. Prepaid POs (a paid vendor deposit) are the priority to chase. Each row projects amount_paid (sum of paid vendor deposits) and age_days.

Required scope: purchase-orders:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token.

Quick filters (flat Spatie QueryBuilder params):

  • filter[search] — search PO number, exact ID, or supplier name
  • filter[supplier_id] — exact supplier id
  • filter[invoice_status] — exact: uninvoiced | partially_invoiced
  • filter[prepaid_only] — true to only include POs with a paid vendor deposit
  • filter[requested] — true = already requested (invoice_requested_at not null); false = never requested

Advanced filters (operator-aware, via GroupedFilterSupport). Send either as a base64-encoded filter_groups tree (AND/OR conjunctions) or as flat filter[column.operator]=value params. Filterable columns:

  • purchase_order_number (text)
  • invoice_status (text)
  • supplier_name (text, matches the related supplier's name)
  • total (numeric — maps to total_cost)
  • purchase_order_date (date)
  • invoice_requested_at (datetime; use is_empty / is_not_empty for never / already requested)
  • invoice_request_count (numeric)

Text operators: contains, does_not_contain, is, is_not, is_one_of, is_not_one_of, starts_with, does_not_start_with, ends_with, does_not_end_with, is_empty, is_not_empty. Numeric operators: is, is_not, is_one_of, is_not_one_of, greater_than, less_than, greater_than_or_equal, less_than_or_equal, between, is_empty, is_not_empty. Datetime operators additionally include before/after and relative shortcuts (today, yesterday, past_week, days_ago, between, etc.).

filter_groups example (before base64-encoding): { "conjunction": "and", "children": [ {"type": "condition", "condition": {"column": "invoice_status", "operator": "is", "value": "partially_invoiced"}}, {"type": "condition", "condition": {"column": "total", "operator": "greater_than", "value": "1000"}} ] }

Sorts: id, purchase_order_number, purchase_order_date, total_cost, amount_paid_total, age_days, invoice_requested_at, invoice_request_count (prefix with - for DESC). Default sort: purchase_order_date.

Pagination: page, per_page (default 15).

Filter update (tab rebuild): supplier_id is now operator-aware (supplier_id.is / .is_not / .is_one_of …) in addition to the flat filter[supplier_id]; prepaid_only and requested also accept the tree form prepaid_only.is / requested.is (value true|false) so they work as FilterInput pills + saved views. Flat forms still work.

Request

Responses

OK

Response Headers
    Content-Type