POST
Add an item to a vendor return
Company space For: Buyer, Stock keeper · Permission: vendor_returns.update, vendor_return_items.create Conditions
  • Both vendor_return_items.create and vendor_returns.update are needed.
  • The supplier return must still be a draft.
  • stockable_id is required, must belong to the organization and cannot already be on this return.
  • stockable_unit_id, when sent, must be a unit of that item.
  • For a stock-tracked item, stock_sources are required; for an untracked one they are refused. Each source names either an asset or a group, may not repeat, must be eligible for the company, and must hold stock tagged with the return’s supplier beyond what other drafts of that supplier reserve. Source quantities must add up to the quantity.
What else happens
  • Adds the line with a cost_total of 0. Stock does not move until the return is confirmed.
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).

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