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.
purchase-orders:readGrant 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
- 200
- 401
- 403
- 404
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.