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.
accounting:writeGrant 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 unlessall_agreeingis 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
- 201
- 401
- 403
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.