Skip to main content

Create Cost Validation Run

POST 

/api/ledger/cost-validation/runs

Confirm a cost check after the account has agreed to its results: the documents are analysed again on the server (the client's figures are never trusted) and the chosen products' agreeing open layers are marked as invoice-backed, which raises cost trust. No cost, inventory value or journal changes. Layers whose cost differs from the documents are never marked. A layer whose cost came from a stock count can be confirmed by purchases dated before the inventory start date; other layers only by purchases on or after it.

Required scope: accounting:write

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

Authentication: Requires Bearer token + accounting.manage_settings permission.

Body: the same fields as Analyse Cost Validation Documents, plus:

  • job_ref (required, max 64): the caller's job id.
  • product_ids (required unless all_agreeing is true): products to confirm.
  • all_agreeing (optional): confirm every product with an agreeing layer.
  • pages_count (optional): pages read.

Each marked layer is vouched for at its current cost: once the layer is revalued, it no longer counts as invoice-backed and a new check can confirm it.

Errors: 422 when none of the chosen products has an agreeing layer (nothing would change), or when those layers were confirmed or revalued between the analysis and the confirmation (nothing is stored; analyse again).

Request​

Responses​

Created

Response Headers
    Content-Type