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

A field name that is not in the writable set is no longer 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 still accepted and ignored, so an object read via GET can be sent back as is.

A row whose fields are unchanged keeps its id. A modified row comes back with a new id even when the previous identifier is sent in the body. To edit a row and keep its id, use PATCH /v1/quotes/:id/products/:rowId.

Set quote products

PUT /v1/quotes/:id/products

Sets the product rows of a quote. Fully replaces the current list — pass all the rows you need.

Request fields (body)

Parameter Type Required Description
Parameteritems Typearray Requiredyes DescriptionArray of product rows
Parameteritems[].productId Typenumber Requiredno DescriptionCatalog product ID. Catalog: GET /v1/products. With neither productId nor productName the row is created with no product and an empty name
Parameteritems[].productName Typestring Requiredno DescriptionRow name — for a free-text row with no catalog product
Parameteritems[].price Typenumber Requiredno DescriptionUnit price. Without it the row is created with a zero price
Parameteritems[].quantity Typenumber Requiredno DescriptionQuantity. Without it the row is created with a quantity of 1
Parameteritems[].discountTypeId Typenumber Requiredno DescriptionHow the discount is set: 1 — as an amount in discount, 2 — as a percentage in discountRate. Defaults to 2
Parameteritems[].discount Typenumber Requiredno DescriptionDiscount amount. Applied only when discountTypeId is 1
Parameteritems[].discountRate Typenumber Requiredno DescriptionDiscount percentage. Applied only when items[].discountTypeId is 2
Parameteritems[].taxRate Typenumber Requiredno DescriptionTax rate (%)
Parameteritems[].taxIncluded Typeboolean Requiredno DescriptionTax included in the price

Examples

curl — personal key

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/quotes/412/products" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      { "productId": 1, "price": 75000, "quantity": 2 },
      { "productId": 5, "price": 10000, "quantity": 1, "discountTypeId": 1, "discount": 1000 }
    ]
  }'

curl — OAuth application

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/quotes/412/products" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      { "productId": 1, "price": 75000, "quantity": 2 },
      { "productId": 5, "price": 10000, "quantity": 1, "discountTypeId": 1, "discount": 1000 }
    ]
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/quotes/412/products', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    items: [
      { productId: 1, price: 75000, quantity: 2 },
      { productId: 5, price: 10000, quantity: 1, discountTypeId: 1, discount: 1000 },
    ],
  }),
})

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/quotes/412/products', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    items: [
      { productId: 1, price: 75000, quantity: 2 },
      { productId: 5, price: 10000, quantity: 1, discountTypeId: 1, discount: 1000 },
    ],
  }),
})

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

Response fields

Field Type Description
Fielddata Typearray DescriptionArray of the resulting product rows with the fields productId, productName, price, quantity, discount, taxRate, taxIncluded

Array of the resulting product rows with the fields productId, productName, price, quantity, discount, taxRate, taxIncluded.

Response example

JSON
{
  "success": true,
  "data": [
    {
      "productId": 1,
      "productName": "Server equipment",
      "price": 75000,
      "quantity": 2,
      "discount": 0,
      "discountTypeId": 2,
      "taxRate": null,
      "taxIncluded": false
    },
    {
      "productId": 5,
      "productName": "Installation and setup",
      "price": 10000,
      "quantity": 1,
      "discount": 1000,
      "discountTypeId": 1,
      "taxRate": null,
      "taxIncluded": false
    }
  ]
}

Error response example

400 — invalid format:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "items must be an array"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionThe body contains a field name that is not among the writable fields — see Product fields
HTTP400 CodeINVALID_PARAMS Descriptionitems is not an array
HTTP400 CodeINVALID_PARAMS DescriptionAn entry in the items array carries no writable product-row field — an empty object, or read-only fields only. The error text lists the writable names
HTTP404 CodeENTITY_NOT_FOUND DescriptionQuote not found
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the crm scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens

Full list of common API errors — Errors.

Known specifics

Full replacement: PUT replaces the entire product list. To add a row — first get the current ones (GET), add the new one to the array, and send everything (PUT). Fetch the whole list: without limit, GET returns only the first page, so pass limit=5000 or page through with offset until meta.hasMore is false. Sending back an incomplete list erases everything it omits.

See also