Skip to main content

Get PO Stale Lines

GET 

/api/purchase-orders/:purchase_order/stale-lines

List the purchase order's stale lines: lines that look abandoned by the supplier and can usually be short-closed. A line is stale only when ALL of these hold:

  • it is a product line on an open purchase order (not marked opening balance) dated more than 90 days ago;
  • it still has unreceived quantity, is not short-closed, and has had no receipt in the last 90 days;
  • its unreceived remainder was never invoiced (non-provisional invoiced quantity is no more than the received quantity);
  • it is not billing-settled;
  • the same product was ordered on a LATER purchase order from the same supplier (not a draft) and received there.
Required scope: purchase-orders:read

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

Each row names the earliest such re-order as the replacement and carries a suggested short-close reason.

Authentication: Requires Bearer token.

Not paginated. Returns an empty data array when nothing is stale.

Response fields (per row): purchase_order_line_id, product_id, sku, product_name, quantity, received_quantity, unreceived_quantity, days_unreceived (days since the purchase order date), reorder_purchase_order_id, reorder_purchase_order_number, reorder_purchase_order_date (ISO 8601), reorder_purchase_order_line_id, reorder_received_quantity, suggested_reason.

The purchase order list supports the matching advanced filter has_stale_lines (operator is, value true/false).

Request​

Responses​

OK

Response Headers
    Content-Type