Close Lost Units with Receiving Discrepancy
POST/api/purchase-orders/:purchase_order/lost-units/receiving-discrepancy
For units the supplier shipped that never arrived (lost or damaged in transit), when no credit is coming. Closes only the given lines and units with a receiving discrepancy; the rest of the purchase order stays open.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
What happens:
- Each line's open quantity drops by the units, so it stops expecting them.
- The open inbound shipment they were on closes received short, and a
lost_in_transitshortfall is recorded (see List Inbound Shipment Shortfalls) for a carrier claim. - The receiving-discrepancy journal entry writes off the billed-but-unreceived part of those units only, at the line's unit cost (DR Receiving Discrepancies / CR Accrued Purchases).
- A line billed for more units than arrived has its billing settled, so its bill stops waiting on a quantity variance.
- The supplier's fill rate counts the units as shipped.
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)transaction_date(optional, nullable, date)
Errors (422): the Receiving Discrepancies nominal code is not mapped (code: receiving_discrepancies_nominal_code_missing), a line is not on this purchase order or is already short-closed, more units than the line still expects, or the purchase order is already closed with a receiving discrepancy.
Requires permission: purchase_orders.receive
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.