[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fitems\u002Fproducts-set":3,"docs-tabs-entities\u002Fitems\u002Fproducts-set":6},{"content":4,"lastmod":5},"\n> 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.\n\n> 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 \u002Fv1\u002Fitems\u002F:entityTypeId\u002F:id\u002Fproducts\u002F:rowId`.\n\n\nUse the `entityTypeId` field from [`GET \u002Fv1\u002Fsmart-processes`](\u002Fdocs\u002Fentities\u002Fsmart-processes\u002Flist) in the `\u002Fv1\u002Fitems\u002F:entityTypeId` path. The type record's internal `id` is a different identifier. For example, if a type is returned as `{ \"id\": 3, \"entityTypeId\": 174 }`, the path starts with `\u002Fv1\u002Fitems\u002F174`. Use the returned value rather than assuming all type IDs start at 1030.\n\n## Set products of a smart process item\n\n`PUT \u002Fv1\u002Fitems\u002F:entityTypeId\u002F:id\u002Fproducts`\n\nSets the product rows of a smart process item. Fully replaces the current list — pass every row you need.\n\n## Request fields (body)\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `entityTypeId` (path) | number | yes | Smart process type ID |\n| `id` (path) | number | yes | Item ID |\n| `items` | array | yes | Array of product rows |\n| `items[].productId` | number | no | Catalog product ID. Catalog: `GET \u002Fv1\u002Fproducts`. Pass `productId` or `productName` — if you pass neither, the row is created with no product and an empty name |\n| `items[].productName` | string | no | Row name — for a free-text row with no catalog product |\n| `items[].price` | number | no | Unit price. If omitted, the row is created with a zero price |\n| `items[].quantity` | number | no | Quantity. If omitted, the row is created with a quantity of `1` |\n| `items[].discountTypeId` | number | no | How the discount is set: `1` — as an amount in `discount`, `2` — as a percentage in `discountRate`. Defaults to `2` |\n| `items[].discount` | number | no | Discount amount. Applied only when `discountTypeId` is `1` |\n| `items[].discountRate` | number | no | Discount percentage. Applied only when `items[].discountTypeId` is `2` |\n| `items[].taxRate` | number | no | Tax rate (%) |\n| `items[].taxIncluded` | boolean | no | Tax included in the price |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PUT \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fitems\u002F180\u002F47\u002Fproducts\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"items\": [\n      { \"productId\": 1, \"price\": 25000, \"quantity\": 2 },\n      { \"productId\": 5, \"price\": 5000, \"quantity\": 1, \"discountTypeId\": 1, \"discount\": 500 }\n    ]\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PUT \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fitems\u002F180\u002F47\u002Fproducts\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"items\": [\n      { \"productId\": 1, \"price\": 25000, \"quantity\": 2 },\n      { \"productId\": 5, \"price\": 5000, \"quantity\": 1, \"discountTypeId\": 1, \"discount\": 500 }\n    ]\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fitems\u002F180\u002F47\u002Fproducts', {\n  method: 'PUT',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    items: [\n      { productId: 1, price: 25000, quantity: 2 },\n      { productId: 5, price: 5000, quantity: 1, discountTypeId: 1, discount: 500 },\n    ],\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fitems\u002F180\u002F47\u002Fproducts', {\n  method: 'PUT',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    items: [\n      { productId: 1, price: 25000, quantity: 2 },\n      { productId: 5, price: 5000, quantity: 1, discountTypeId: 1, discount: 500 },\n    ],\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `data` | array | Array of the resulting product rows with the fields productId, productName, price, quantity, discount, taxRate, taxIncluded |\n\nArray of the resulting product rows with the fields `productId`, `productName`, `price`, `quantity`, `discount`, `taxRate`, `taxIncluded`.\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"productId\": 1,\n      \"productName\": \"Server equipment\",\n      \"price\": 25000,\n      \"quantity\": 2,\n      \"discount\": 0,\n      \"discountTypeId\": 2,\n      \"taxRate\": null,\n      \"taxIncluded\": false\n    },\n    {\n      \"productId\": 5,\n      \"productName\": \"Installation and setup\",\n      \"price\": 5000,\n      \"quantity\": 1,\n      \"discount\": 500,\n      \"discountTypeId\": 1,\n      \"taxRate\": null,\n      \"taxIncluded\": false\n    }\n  ]\n}\n```\n\n## Error response example\n\n400 — invalid format:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"items must be an array\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | The body contains a field name that is not among the writable fields — see [Product fields](\u002Fdocs\u002Fentities\u002Fitems\u002Fproducts-fields) |\n| 400 | `INVALID_DYNAMIC_PARAM` | `entityTypeId` is not a positive integer or is reserved (1, 2, 3, 4, 7, 31) |\n| 400 | `INVALID_PARAMS` | `items` is not an array or an array element is not a product-row object |\n| 400 | `INVALID_PARAMS` | An 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 |\n| 404 | `ENTITY_NOT_FOUND` | Item not found |\n| 403 | `SCOPE_DENIED` | The API key does not have the `crm` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Full replacement:** PUT replaces the entire product list. To add a row, first fetch the current ones (`GET`), append the new one to the array, then send everything (`PUT`). Fetch the list in full: without `limit`, [`GET`](.\u002Fproducts-get.md) 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.\n\n## See also\n\n- [Product rows](\u002Fdocs\u002Fentities\u002Fitems\u002Fproducts-get)\n- [Get item](\u002Fdocs\u002Fentities\u002Fitems\u002Fget)\n- [CRM products](\u002Fdocs\u002Fentities\u002Fproducts)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","2026-10-13",{},1794739384599]