Edit

[POST] .../v1/docopeningbalance/edit

Edits opening settlement document with partner. Patch an unposted opening balance by id and return row_affected. Requires opening balance edit permission. Omitted currency and exchange rate are preserved. For stock_id, omitted/null preserves and zero clears; the resulting stock must match the company. Missing documents return 1044, posted documents 1150, empty patches 1004 and unchanged updates 1009, as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
credit Decimal Optional New credit amount value with up to 3 decimal places. Values less than or equal to 0 leave the existing credit unchanged.
currency_id Int64 Optional New currency ID. Values less than or equal to 0 leave the existing currency unchanged.
date Int64 Optional New document date as Unix time in seconds. Values less than or equal to 0 leave the existing date unchanged.
debit Decimal Optional New debit amount value with up to 3 decimal places. Values less than or equal to 0 leave the existing debit unchanged.
exchange_rate Decimal Optional New exchange rate relative to the base currency. Omitted or zero preserves the current rate unless changing to the base currency, which uses 1. Explicit rates for the base currency are normalized to 1; positive non-base rates must fit decimal(18,8).
firm_id Int64 Optional New company ID. Values less than or equal to 0 leave the existing company unchanged.
id Int64 Required Required opening partner balance document ID.
partner_id Int64 Optional New partner ID. Values less than or equal to 0 leave the existing partner unchanged.
stock_id Int64 Optional Optional stock patch for an unposted document: omitted or null leaves it unchanged, 0 clears it and a positive ID sets it. The resulting stock must belong to the resulting company.

Request Example

{
  "id": 26,
  "date": 1712016000,
  "debit": 1300000.000,
  "credit": 275000.000,
  "exchange_rate": 1.00000000,
  "currency_id": 1
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 1
  }
}