PUT
Edit a vendor return item
Company space For: Buyer, Stock keeper · Permission: vendor_returns.update, vendor_return_items.update Conditions
  • Both vendor_return_items.update and vendor_returns.update are needed.
  • The supplier return must still be a draft.
  • stockable_id cannot be changed: it is refused.
  • Omitted fields keep their current value, so changing the quantity without sending stock_sources re-checks the existing sources and refuses a mismatch.
  • The unit, quantity and stock sources follow the same checks as when adding an item, not counting the line itself.
Part of Return goods to suppliers.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

vendor_return
string
required

Identifier of the vendor return (27-character KSUID string).

item
string
required

Identifier of the supplier return item (27-character KSUID string).

Body

application/json
stockable_id
string
required

Identifier of the item returned. Required when adding a line; it must belong to the organization and not already be on the return. Not accepted when changing a line.

quantity
integer
required

Quantity returned, in the chosen unit, above zero. Required when adding a line.

stockable_unit_id
string | null

Unit the quantity is expressed in; it must be a unit of that item. When adding, the base unit is used if omitted; when changing, omitting it keeps the current unit.

stock_sources
object[] | null

Stock the goods are taken from. Required for a stock-tracked item and refused for an untracked one; the quantities must add up to quantity. When changing a line, omitting it keeps the current sources.

Response

VendorReturnItemResource

id
string
required

Identifier of the return line (27-character KSUID string).

return_id
string
required

Identifier of the supplier return the line belongs to.

stockable_id
string
required

Identifier of the item returned.

stockable_unit_id
string | null
required

Identifier of the unit the quantity is expressed in; null when the base unit is used.

stock_sources
array
required

Where the goods are taken from: a list of {quantity, asset_id} or {quantity, group_id}. Empty for a item that is not stock-tracked.

quantity
integer
required

Quantity returned, in the line's unit.

cost_total
number
required

Inventory cost of the stock that left when the return was confirmed in major units (the minor-unit amount divided by 10 to the power currency_exponent). 0 while the return is a draft and for untracked lines.

created_at
string<date-time>
required

Date and time the record was created (ISO 8601, UTC).

updated_at
string<date-time>
required

Date and time the record was last changed (ISO 8601, UTC).