Skip to main content

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.

Required scope: purchase-orders:write

Grant 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_transit shortfall 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-closed
  • lines.*.quantity (required, numeric, > 0): units that shipped and never arrived; cannot exceed what the line still expects to receive
  • reason (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​

Created

Response Headers
    Content-Type