Edit

[POST] .../v1/docproduction/edit

Edits production document. Update production document header fields before the document is posted, for example date, stock_id or description. The request body must contain id; date 0 means no date change, stock_id 0 means no stock change, description null means no description change and attached_user_id is accepted by the request model but is not stored by this method. Production must be enabled, the document must be locked by the current user, unposted, not deleted and outside closed-period restrictions and the current request user must have production document edit permission. Missing body, invalid id, disabled production, denied access, closed-period conflicts, missing update fields, lock conflicts, posted documents, no affected rows, storage errors or webhook failures are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
attached_user_id Int64 Optional Responsible user ID. Currently accepted; this method does not update the stored responsible user.
date Int64 Optional Production document date as Unix time. If 0, the stored date is not changed.
description String Optional Note. Maximum length is 300 characters.
id Int64 Required Production document ID.
stock_id Int64 Optional Stock ID. If 0, the stored stock is not changed.

Request Example

{
  "id": 7401,
  "date": 1767315600,
  "stock_id": 3,
  "description": "Assembly run after stock check"
}

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