Edit

[POST] .../v1/docmovement/edit

Edits document movement. Use this method to update movement document header fields before posting, for example date, sender stock, receiver stock, description or responsible user. The document id is required, sender and receiver stocks cannot be equal when both are provided and persistent validation requires the document to exist, be locked by the current user, remain unposted and use stocks from the same firm. Optional fields update only when their change marker is present: date 0 means no change, negative stock ids mean no change, description null means no change, attached_user_id null means no change and attached_user_id 0 clears the responsible user. The caller must have document movement edit permission; missing body, invalid id, same sender and receiver stock, unavailable tariff, stock access errors, missing update fields, lock conflicts, denied access or storage failures are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
attached_user_id Int64 Optional Responsible user ID. Null means no change, 0 clears the responsible user and a positive value assigns that user.
date Int64 Optional Document date as Unix time in seconds. If 0, the stored date is not changed.
description String Optional Additional description. Maximum length is 300 characters; null means no change.
id Int64 Required Movement document ID.
stock_receiver_id Int64 Optional Receiver stock ID. If negative, the stored receiver stock is not changed.
stock_sender_id Int64 Optional Sender stock ID. If negative, the stored sender stock is not changed.

Request Example

{
  "id": 4201,
  "date": 1767229200,
  "stock_sender_id": 11,
  "stock_receiver_id": 12,
  "description": "Updated transfer note",
  "attached_user_id": 5
}

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
  }
}