For AI agents: markdown of this page — /docs-content-en/entities/invoices/products-update.md documentation index — /llms.txt

Update an invoice product

PATCH /v1/invoices/:id/products/:rowId

Updates an invoice product row. Pass only the fields being changed.

Field names are validated. A field name that is not in the writable set is not dropped silently: the request is rejected with 400 INVALID_PARAMS and the error text lists the writable names. Read-only fields that appear in product-row responses — priceAccount, ownerId, storeId and others — are accepted and ignored, so an object read via GET can be sent back as is.

Parameters

Parameter Type Req. Description
id (path) number yes Invoice ID
rowId (path) number yes Product row ID (from the list or add response, not the productId from the catalog)

Request fields (body)

Field Type Description
price number Price per unit
quantity number Quantity
productId number Product ID. Catalog: GET /v1/products
discountTypeId number How the discount is set: 1 — as an amount in discount, 2 — as a percentage in discountRate. Omitting the field keeps the row's current value — to switch the discount mode, send it explicitly
discount number Discount amount. Applied only when discountTypeId is 1
discountRate number Discount percentage. Applied only when discountTypeId is 2
taxRate number Tax rate (%)
taxIncluded boolean Tax included in the price
sort number Sort order

Examples

curl — personal key

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/invoices/741/products/1471" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "price": 9999, "quantity": 10 }'

curl — OAuth application

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/invoices/741/products/1471" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "price": 9999, "quantity": 10 }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/invoices/741/products/1471', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ price: 9999, quantity: 10 }),
})

const { success, data } = await res.json()
console.log('Updated:', data.price, 'x', data.quantity)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/invoices/741/products/1471', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ price: 9999, quantity: 10 }),
})

const { success, data } = await res.json()

Response fields

Field Type Description
success boolean Always true on success
data object The updated product row in full. All fields — see Product fields

Response example

JSON
{
  "success": true,
  "data": {
    "id": 1471,
    "productId": 1,
    "productName": "Server equipment",
    "price": 9999,
    "quantity": 10,
    "discount": 0,
    "taxRate": null,
    "taxIncluded": false
  }
}

Error response example

404 — product row not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Item not found"
  }
}

Errors

HTTP Code Description
400 INVALID_PARAMS The body contains a field name that is not among the writable fields — see Product fields
404 ENTITY_NOT_FOUND Product row not found
400 INVALID_ROW_ID The rowId in the URL is not a positive integer
403 SCOPE_DENIED API key lacks the crm scope
401 TOKEN_MISSING API key has no configured tokens

Full list of common API errors — Errors.

See also