Close

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

Closes an inventory count and optionally creates adjustment documents. Close an open inventory document after its counted rows are ready. The stock inventory tariff option must be enabled, id is required and this 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. If creating linked documents fails, the inventory remains closed; check its state and linked documents before retrying. 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, storage errors 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
  }
}