Close

[POST] .../v1/docinventory/close

Closes inventory document Use this workflow method to close an open inventory document after its counted rows are ready. The stock inventory tariff option must be enabled, id is required and this controller method does not perform a separate RBAC permission check; the document must exist, satisfy the document lock contract, not already be closed, have an open_date earlier than the current close date, have no active period-closing conflict and have no deleted-mark items in operations. For partial inventory, at least one operation row must exist; when create_docinout is true the method also creates receipt and write-off documents from the inventory result after closing. Business errors such as missing body, invalid id, disabled tariff option, document not found, lock failure, already closed state, invalid date sequence, period-closing conflict, missing rows, deleted items in operations, no affected row, database failures or linked document creation failures are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
id Int64 Required Inventory document ID.

Request Example

{
  "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": {
    "ids": [
      null
    ],
    "row_affected": 1
  }
}