Get Short-Close Shipment Exposure
POST/api/purchase-orders/:purchase_order/short-close/shipment-exposure
Show what short-closing the given lines would take off the purchase order's open inbound shipments. Nothing is changed.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Each line also reports requested_quantity (units the close takes off the line) and shipped_open_quantity (units on shipped open shipments: the most that can be closed as lost in transit).
Authentication: Requires Bearer token.
Request body fields:
lines(required, array, 1–500 items)lines.*.purchase_order_line_id(required, integer): a line on this purchase order (other ids are ignored)lines.*.closed_quantity(required, numeric, min 0): the quantity the line would be short-closed to
Response: in_transit_quantity is the units on shipments that have already shipped (In Transit / Partially Received) — when it is above 0, short-closing needs a shipment_resolution. unshipped_quantity is the units on Draft/Planned shipments, which are removed automatically. lines.*.shipments lists each shipment line affected and how many units would come off it (the newest shipment first).
Requires permission: purchase_orders.show
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 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.
Unprocessable Entity
Response Headers
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.