Skip to main content

Get Impact Preview

GET 

/api/cost-changes/:costChange/impact-preview

Returns the side-by-side comparison a reviewer decides from. Each row in periods is one accounting month with what each convention books there: restating puts the delta back where the stock was received (restate_valuation_impact on Inventory for every unit received, then each unit already sold moves from Inventory to cost of goods in the month it shipped, as restate_cogs_impact), while going forward books the whole delta as one dated catch-up (prospective_impact, split into prospective_valuation_impact and prospective_cogs_impact). Both sides add back to the set's total delta. locked and closed mark the period's accounting status; clamped_to is the first open day a locked period's write would be displaced to.

Required scope: inventory:read

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

prospective_anchor_options lists the days a going-forward application can anchor on: the day the change was entered, the trigger document's own date (with eligible and a reason when it is not usable), and a custom window (min_date, max_date, lock_date, in_closed_period).

restate_blocked_reason is null when restate is a real option. When it is set, restate is refused for this change everywhere - here, on apply, on switch and in bulk resolve - because one or more original receipt months are behind the accounting lock date; the sentence explains which months and where the ledger would otherwise displace the write.

blocked_by lists older pending sets that must be resolved first because they touch the same FIFO layers. preview_stale is true when another change has moved a layer's base cost since this set was staged. downstream previews stock built or transferred from the affected layers (kits, transfers) that would be re-costed too, splitting each row into the part this change causes and any pre-existing drift; supported is false with an error when the bill of materials is recursive.

recorded is null until the change is applied. For an APPLIED change the impact reports what was actually booked rather than a re-run of the preview against today's layers: recorded is {resolution, on_hand, consumed, total} (the resolution that was applied, the amount booked to Inventory for units still on hand, the amount booked to cost of goods sold for units already consumed, and their sum), periods carries those booked figures per month on the applied side (restate_* or prospective_*), preview_stale is false and downstream is null (the cascade into stock made from these layers already ran on apply). Passing prospective_date on an applied change is a what-if and still returns the live preview with recorded null.

Authentication: Requires Bearer token (inventory scope).

Path params:

  • costChange: Cost change set ID

Query params:

  • prospective_date (optional, Y-m-d): recompute the going-forward side for the day a reviewer is considering. Returns 409 when that day is before the latest original receipt, in the future, or behind the accounting lock.

Request​

Responses​

OK

Response Headers
    Content-Type