PUT
Edit a damaged item
Company space For: Stock keeper, Manager · Permission: inventory_damages.update, inventory_damage_items.update Conditions
  • Only a draft record can be changed: a confirmed record is refused (409).
  • stockable_id cannot be changed: it is refused on update.
  • When stock_sources is sent it replaces the whole list and needs at least one source; the quantity is recomputed as the sum of the source quantities.
  • The new sources are checked against available stock, ignoring this item’s own reservation.
What else happens
  • Replaces the unit and sources of the item and resets cost_total to 0.
Part of Correct stock and declare damage.

Authorizations

Authorization
string
header
required

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

Path Parameters

inventory_damage
string
required

Identifier of the damage record (27-character KSUID).

item
string
required

Identifier of the reception line (not the purchase line) of the delivery or pickup named in the path (27-character KSUID). It must belong to that reception.

Body

application/json
stockable_id
string
required

Identifier of the inventory-tracked item that is damaged (27-character KSUID). Required when adding an item and unique within the record. Not accepted: on update the damaged item stays the one named in the URL.

stock_sources
object[]
required

Stock sources the damaged quantity is taken from. Each source names exactly one location (asset_id) or lot group (group_id) and a quantity; at least one source is required. On update, when sent it replaces all the existing sources.

Minimum array length: 1
stockable_unit_id
string | null

Optional unit in which the source quantities are expressed; when omitted on creation the base unit is used. On update, omitting it keeps the current unit.

Response

InventoryDamageItemResource

id
string
required

Identifier of the item (27-character KSUID).

inventory_damage_id
string
required

Identifier of the damage record the item belongs to.

stockable_id
string
required

Identifier of the damaged item.

stockable_unit_id
string | null
required

Unit in which the quantity is expressed; null when it is in the base unit.

quantity
integer
required

Damaged quantity in the item's unit, the sum of the source quantities.

stock_sources
array
required

Sources the quantity is taken from, as a list of objects with quantity and either asset_id or group_id.

cost_total
number
required

Cost of the lost stock in major units of the company currency. It is 0 until the record is confirmed, then the cost of the lots removed.

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