Skip to main content

Apply Cost Change

POST 

/api/cost-changes/:costChange/apply

Applies a cost change awaiting review, writing the staged deltas onto the affected FIFO layers, re-costing anything built or transferred from them, and posting the revaluations to the ledger. The cost is re-derived from the live documents at apply time, so a stale preview never produces a stale write.

Required scope: inventory:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

resolution chooses the dating: restate records each layer's delta on its original receipt date, re-reporting those months; prospective books the whole delta on a single day going forward.

For prospective, prospective_anchor picks that day: entered (the day the change was entered - the default), document (the trigger document's own date, only when it is later than the latest original receipt) or custom (a day you choose in prospective_date, which must be on or after the latest original receipt, not in the future and after the accounting lock). Each layer is still clamped to no earlier than its own receipt.

Responds 422 when resolution is restate and any of the set's original receipt months are behind the accounting lock date - the message is the same restate_blocked_reason the listing and previews show - or when an older pending change touches the same FIFO layers and must be resolved first. Responds 409 when the change is not awaiting review, or the chosen posting day is outside the allowed window.

Authentication: Requires Bearer token (inventory scope) and permission to resolve cost changes.

Path params:

  • costChange: Cost change set ID

Body fields:

  • resolution (required): restate or prospective
  • prospective_anchor (optional): entered, document or custom; defaults to entered. Ignored for restate
  • prospective_date (optional, Y-m-d): required when prospective_anchor is custom
  • notes (optional, max 2000 chars): recorded on the decision

Request

Responses

OK

Response Headers
    Content-Type