[POST] .../v1/invoiceoperation/add
Creates operation account-invoice. Use this method after creating and locking an account-invoice to add one or more item rows to the invoice document. The request body is a root JSON array; it must contain 1 to 250 operations, every array item must reference the same document_id and each item_id, positive quantity, non-negative price and optional vat_value is validated before persistence. The parent invoice must exist, be locked by the current request user and be editable; item rows cannot use deleted items, compound items or item groups with child items. The current request user must have invoice operation add permission and the successful response returns row_affected and ids of created operations; validation, permission, item-state, document-state, lock and database failures are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| document_id | Int64 | Required | Invoice document ID that receives the operation. |
| item_id | Int64 | Required | Item ID to include in the invoice. |
| price | Decimal | Required | Invoiced item price. Must be zero or greater and no greater than 99999999999. |
| quantity | Decimal | Required | Invoiced item quantity. Must be greater than zero and no greater than 999999999. |
| vat_value | Decimal | Optional | VAT rate value for the invoice row. Null uses the item's VAT rate; -1 is accepted for without-VAT behavior. |
Request Example
[
{
"document_id": 5101,
"item_id": 1001,
"quantity": 3,
"price": 50000,
"vat_value": 12
}
]
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
]
}
}