Add

[POST] .../v1/setpriceoperation/add

Adds item lines to a price setting document. Add one or more item rows to a price setting document before the document is posted. The request body is a JSON array batch; every row must contain document_id and item_id, base_value and new_value must be zero or greater, values must stay within the method numeric limits and all rows must reference the same document_id. If new_value is 0 while base_value is positive, the method calculates the new price from the document price type markup and rounding settings. The response returns row_affected and ids for created operations and the current request user must have price setting operation add permission; null, empty or oversized arrays, mixed document_ids, invalid prices, denied access, locked or invalid document state and storage failures are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
base_value Decimal Optional Current base price before the change. Must be zero or greater.
document_id Int64 Required Price setting document ID that receives the operation.
item_id Int64 Required Item ID whose price is being changed.
new_value Decimal Optional New price value to set. Must be zero or greater; if 0 with positive base_value, the API calculates it from the document price type markup.
order Int64 Optional Operation order inside the document. Null means not set and is stored as NULL in the database. Ignored for database versions earlier than 407.

Request Example

[
  {
    "document_id": 6101,
    "item_id": 1001,
    "base_value": 42000,
    "new_value": 48000
  }
]

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,
    "ids": [
      8101
    ]
  }
}