AddToCompound

[POST] .../v1/item/addtocompound

Adds an item record to a compound item. Use this method to add a component item to the composition of a compound item. It requires compound_id, item_id and a positive quantity, checks item edit permission, updates the compound composition and returns row_affected. Business errors such as a missing request body, invalid identifiers or quantity, denied access, locked or invalid compound state and persistent errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
compound_id Int64 Required Compound item ID.
item_id Int64 Required ID of the item to add.
quantity Decimal Optional Quantity of the item to add. Default is 1.

Request Example

{
  "compound_id": 1,
  "item_id": 1,
  "quantity": 1.0
}

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