Close Lost Units with Vendor Credit
POST/api/purchase-orders/:purchase_order/lost-units/vendor-credit
For units the supplier shipped that never arrived, when the supplier is crediting them. Creates a draft vendor credit (reason short_shipped) with one line per purchase order line at its unit cost, and closes those units off the lines and their open inbound shipments, recording a lost_in_transit shortfall linked to the credit. Review and authorize the credit as usual. The supplier's fill rate counts the units as shipped.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Undo the line close with Undo Short-Close; the credit stays for you to void.
Authentication: Requires Bearer token.
Request body fields:
lines(required, array, 1–500 items)lines.*.purchase_order_line_id(required, integer, distinct): a line on this purchase order that is not already short-closedlines.*.quantity(required, numeric, > 0): units that shipped and never arrived; cannot exceed what the line still expects to receivereason(optional, nullable, max 500)
Errors (422): a line is not on this purchase order or is already short-closed, more units than the line still expects, or a quantity that is not a whole number (vendor credits take whole units).
Requires permission: purchase_orders.update
Request
Responses
- 201
- 401
- 403
- 404
- 422
- 429
Created
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.