SetPriceByPriceType

[POST] .../v1/invoiceoperation/setpricebypricetype

Fills prices in invoice operations by the specified price type Use this method on a locked account-invoice to fill all invoice operation prices from the specified price type, with currency conversion performed by the persistent layer when needed. The method changes existing operation prices for document_id and returns row_affected with ids of rows whose prices were updated. The parent invoice must be editable and locked by the current request user and document_id and price_type_id must reference existing records. The current request user must have invoice operation edit permission; missing body, invalid ids, denied permission, missing price type, lock or document-state failures and database failures are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
document_id Int64 Required Document ID for setting operation prices by price type. The supported document kind depends on the controller route.
price_type_id Int64 Required Price type ID.

Request Example

{
  "document_id": 5101,
  "price_type_id": 7
}

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": 2,
    "ids": [
      9101,
      9102
    ]
  }
}