POST
Confirm a damage record
Company space Cannot be undone For: Stock keeper, Manager · Permission: inventory_damages.confirm Conditions
  • Only a draft can be confirmed; a record already confirmed is refused (409).
  • The record must still have at least one item, otherwise 409.
  • A record tied to a purchase or reception is checked again: the reception must still be confirmed.
  • Every item and stock source is validated again against the stock available at confirmation time, so a draft that was valid when created can be refused with 422 if the stock has since dropped.
What else happens
  • Removes the declared quantities from stock, oldest lots first within each source, and records the movements in the stock history under the inventory_damage operation.
  • Stores on each item the cost of the lots removed in cost_total, in minor units internally (returned in major units).
  • Sets the status to confirmed and fills confirmed_at.
  • No accounting entry is created by this action in the code.
  • The record cannot be edited or deleted afterwards.
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

inventoryDamage
string
required

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

Response

200 - application/json

InventoryDamageResource

id
string
required

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

purchase_id
string | null
required

Purchase the damage is tied to; null when the record has no purchase origin.

purchase_reception_id
string | null
required

Purchase reception the damage is tied to; null when the record has no reception origin.

reference
string | null
required

Free reference of the record; null when none was given.

status
string
required

State of the record: draft (editable, no stock moved) or confirmed (stock removed, no more changes).

damage_reason
string
required

Reason of the damage: ordinary or exceptional.

confirmed_at
string<date-time> | null
required

Date and time of confirmation (ISO 8601); null while the record is a draft.

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

items
InventoryDamageItemResource · object[]

Damaged items of the record.