Add

[POST] .../v1/inventoryoperation/add

Creates operation inventory. Use this batch method to add or restore multiple item rows in an open inventory document. The request body is an array of operations, requires the inventory operation add permission, must contain 1 to 250 rows, all rows must belong to the same document and update_actual_quantity must be present and consistent across the batch. Each row requires document_id, item_id and non-negative actual_quantity; the parent inventory document must exist, be editable under the document lock contract and cannot accept compound, deleted-mark or nested items. Existing rows for the same item are updated rather than duplicated, price is taken from the document price type and business errors such as invalid fields, denied access, closed/deleted/full document restrictions, lock failure, invalid items, quantity overflow, database failures or persistent validation errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
actual_quantity Decimal Required Actual counted item quantity for the inventory row. Required; zero is allowed and negative values are rejected.
datetime Int64 Optional Date used to calculate quantity data.
document_id Int64 Required Inventory document ID that receives the operation.
item_id Int64 Required Item ID to include in the inventory document.
update_actual_quantity Boolean Required When changed manually, this value is applied only if update_actual_quantity is true. Otherwise, the sent actual_quantity is added to the actual_quantity stored in the database.

Request Example

[
  {
    "actual_quantity": 1.0,
    "datetime": 1,
    "document_id": 1,
    "item_id": 1,
    "update_actual_quantity": true
  }
]

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