> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qobra.co/llms.txt
> Use this file to discover all available pages before exploring further.

# update_statement_adjustments

> Override computed values on one statement, or remove overrides, and recalculate the statement. All or nothing, at most 50 overrides per call.

Override computed values on one statement, or remove overrides, and recalculate
the statement.

An override replaces the value the compensation computed, for this statement
only. It applies to a variable of one of the statement's lines (a KPI, an
intermediate result, the line's amount) or to a calculated field of one of the
records the line counts.

Only the overrides sent are written. An override left out keeps its value, and
`value: null` removes one, bringing the computed value back. Read the ids
first:

* [`get_statement`](https://docs.qobra.co/mcp_documentation/tools/get_statement) lists the lines'
  `compensation_id`.
* [`get_statement_compensation`](https://docs.qobra.co/mcp_documentation/tools/get_statement_compensation)
  lists the variables' `id`.
* [`list_statement_records`](https://docs.qobra.co/mcp_documentation/tools/list_statement_records)
  lists the records' `record_id` and the fields' `id`. Only fields with
  `calculated: true` can be overridden.

Amounts are in the statement's calculation currency, and a percentage is the
ratio (0.8 for 80%). Only amount, float, percentage and text values can be
overridden. A record's field read from its data table cannot: change it on the
record with [`update_record`](https://docs.qobra.co/mcp_documentation/tools/update_record).

The call is all or nothing. An unknown id, a value of the wrong kind or a
missing reason refuses the whole call before anything is written. A locked
statement is refused. When the company requires a reason for statement
adjustments, each override cites one of the `adjustment_reasons`
[`get_statement`](https://docs.qobra.co/mcp_documentation/tools/get_statement) lists. When the
company requires none (`adjustment_reasons` is null), a `reason` is refused:
put a free-text note in `comment` instead.

When a value changes, Qobra launches the statement's recalculation. Its amounts
are stale until get\_statement reports `calculation_status` `ready`. Only this
statement is recalculated: when later months build on it (a carried balance, a
year-to-date total), call
[`recalculate_statements`](https://docs.qobra.co/mcp_documentation/tools/recalculate_statements) on
them.

Available only where the Qobra write tools beta is enabled.
Every write to the live environment is recorded in the audit trail as the
`Qobra MCP` agent; writes to a sandbox are not audited.

## Parameters

> [accordion] Body
>
> **statement\_id** `string` *required*
>
> Id of the statement to adjust — the id list\_statements returns.
>
> **variable\_overrides** `object[]` *required*
>
> The values to override, each on a variable of one of the statement's lines
> or on a calculated field of one of its records. At most 50 per call.
>
> **object properties**
>
> **compensation\_id** `string` *required*
>
> Id of the statement's line the variable belongs to, a `compensation_id`
> get\_statement lists.
>
> **variable\_id** `string` *required*
>
> Id of the variable to override: a variable's `id`
> get\_statement\_compensation lists for that line, or, with `record_id`,
> the `id` of a calculated field list\_statement\_records lists.
>
> **record\_id** `string`
>
> Id of the record whose calculated field to override, a `record_id`
> list\_statement\_records returns. Omit it to override a variable of the
> line itself.
>
> **value** `number | string | null` *required*
>
> The value to set: a number for an amount (in the statement's
> calculation currency), a float or a percentage (the ratio, 0.8 for
> 80%), a text for a text variable. null removes the override and brings
> the computed value back.
>
> **reason** `string`
>
> Why the value is overridden, one of the `adjustment_reasons`
> get\_statement lists. Required when that list is not null, refused when
> it is `null`: a free-text note goes in `comment`.
>
> **comment** `string`
>
> A comment kept with the change in the statement's activity.

## Example

Override a line's amount and remove the override on a record's calculated
field:

```json theme={null}
{
  "statement_id": "66a0b1c2d3e4f50012345678",
  "variable_overrides": [
    {
      "compensation_id": "66a0b1c2d3e4f50012341111",
      "variable_id": "66a0b1c2d3e4f50012342222",
      "value": 1500,
      "reason": "Commercial gesture",
      "comment": "Agreed with the sales director"
    },
    {
      "compensation_id": "66a0b1c2d3e4f50012341111",
      "variable_id": "66a0b1c2d3e4f50012343333",
      "record_id": "66a0b1c2d3e4f50012344444",
      "value": null
    }
  ]
}
```

## Response

> [accordion] Body
>
> **statement\_id** `string`
>
> **resource\_url** `string`
>
> Deep link to the statement in the Qobra web app.
>
> **recalculation\_launched** `boolean`
>
> True when a value changed and the statement's recalculation was launched:
> its amounts are stale until get\_statement reports calculation\_status ready.
>
> **changes** `object[]`
>
> One row per override sent, in the order sent.
>
> **object properties**
>
> **compensation** `object`
>
> **object properties**
>
> **id** `string`
>
> **name** `string`
>
> **resolved** `boolean`
>
> **variable** `object`
>
> **object properties**
>
> **id** `string`
>
> **name** `string`
>
> **resolved** `boolean`
>
> **record** `object`
>
> The record whose calculated field this is, null for a variable of the
> line itself.
>
> **object properties**
>
> **id** `string`
>
> **name** `string`
>
> **resolved** `boolean`
>
> **action** `string`
>
> What the call did: created (a new override), updated (another value on
> an existing override), removed (the override is gone, the computed value
> is back), annotated (same value, a new reason or comment logged),
> unchanged (nothing to write: the value is already the one sent, or there
> was no override to remove). One of: `created`, `updated`, `removed`,
> `annotated`, `unchanged`.
>
> **value** `number | string`
>
> The value sent; null when it asked for the override to be removed.
