Skip to main content

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.

Required scope: purchase-orders:write

Grant 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-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)

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​

Created

Response Headers
    Content-Type