Short-Close PO Line
POST/api/purchase-order-lines/:purchase_order_line/short-close
Short-close a PO line at a smaller closed_quantity than originally ordered. Records an audit event (PurchaseOrderLineShortCloseEvent) and mutates the line's quantity to the new effective ordered amount. The line's own save propagates the change into demand-planning coverages.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Request body fields:
closed_quantity(required, numeric, min 0): the new effective ordered quantity. Must be less than the original ordered quantity AND greater than or equal to the already-received quantity.reason(optional, nullable, max 500): free-text reason for the short-close, recorded on the event.
Validation rules (422):
- A PO line can only have one active short-close at a time — undo the existing one first.
closed_quantitymust be less than the original ordered quantity.closed_quantitycannot be less than the already-received quantity.
Returns the created PurchaseOrderLineShortCloseEvent (eager-loaded with closedBy and followUpPurchaseOrder).
Request
Responses
- 201
- 401
- 403
- 404
- 422
- 429
Created
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
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.