[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fdeals\u002Fproducts-update":3,"docs-tabs-entities\u002Fdeals\u002Fproducts-update":6},{"content":4,"lastmod":5},"## Update a deal product\n\n`PATCH \u002Fv1\u002Fdeals\u002F:id\u002Fproducts\u002F:rowId`\n\nUpdates a deal product row. Pass only the fields you want to change.\n\n> **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.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Deal ID. List: [`GET \u002Fv1\u002Fdeals`](\u002Fdocs\u002Fentities\u002Fdeals\u002Flist) |\n| `rowId` (path) | number | yes | Product row ID, not the catalog `productId`. List: [`GET \u002Fv1\u002Fdeals\u002F:id\u002Fproducts`](\u002Fdocs\u002Fentities\u002Fdeals\u002Fproducts-get) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `price` | number | no | Unit price |\n| `quantity` | number | no | Quantity |\n| `productId` | number | no | Product ID. Catalog: [`GET \u002Fv1\u002Fproducts`](\u002Fdocs\u002Fentities\u002Fproducts\u002Flist) |\n| `productName` | string | no | Row name |\n| `discountTypeId` | number | no | 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 |\n| `discount` | number | no | Discount amount. Applied only when `discountTypeId` is `1` |\n| `discountRate` | number | no | Discount percentage. Applied only when `discountTypeId` is `2` |\n| `taxRate` | number | no | Tax rate (%) |\n| `taxIncluded` | boolean | no | Tax included in the price |\n| `measureCode` | number | no | Unit of measure code, for example `796` — piece. List: [`GET \u002Fv1\u002Fcatalog-measures`](\u002Fdocs\u002Fentities\u002Fcatalog-measures\u002Flist) |\n| `sort` | number | no | Sort order |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F8815\u002Fproducts\u002F2369\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"price\": 9999, \"quantity\": 10 }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F8815\u002Fproducts\u002F2369\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"price\": 9999, \"quantity\": 10 }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F8815\u002Fproducts\u002F2369', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ price: 9999, quantity: 10 }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Updated:', data.price, 'x', data.quantity)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F8815\u002Fproducts\u002F2369', {\n  method: 'PATCH',\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({ price: 9999, quantity: 10 }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | The full updated product row (`id` stays the same). Row fields — see [Product fields](\u002Fdocs\u002Fentities\u002Fdeals\u002Fproducts-fields) |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 2369,\n    \"ownerId\": 8815,\n    \"ownerType\": \"D\",\n    \"productId\": 6967,\n    \"productName\": \"Parent product\",\n    \"price\": 9999,\n    \"priceAccount\": 9999,\n    \"priceExclusive\": 9999,\n    \"priceNetto\": 9999,\n    \"priceBrutto\": 9999,\n    \"quantity\": 10,\n    \"discountTypeId\": 2,\n    \"discountRate\": 0,\n    \"discount\": 0,\n    \"taxRate\": null,\n    \"taxIncluded\": false,\n    \"customized\": \"Y\",\n    \"measureCode\": 796,\n    \"measureName\": \"pcs\",\n    \"sort\": 0,\n    \"xmlId\": \"sale_basket_1399\",\n    \"type\": 3,\n    \"storeId\": null\n  }\n}\n```\n\n## Error response example\n\n404 — row not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Item not found\"\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\u002Fdeals\u002Fproducts-fields) |\n| 400 | `INVALID_PARAMS` | The body carries no writable product-row field — an empty object, or read-only fields only. The error text lists the writable names |\n| 400 | `INVALID_ROW_ID` | `rowId` in the path is not a positive integer. The message is `Product row ID must be a positive integer` |\n| 404 | `ENTITY_NOT_FOUND` | No product row with this `rowId`. The message is `Item not found` |\n| 404 | `ENTITY_NOT_FOUND` | A row with this `rowId` exists but belongs to another CRM record, not to deal `id`, or carries no owner and cannot pass the check. The message is `Product row not found` |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 403 | `SCOPE_DENIED` | The API key lacks 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## See also\n\n- [Get a product](\u002Fdocs\u002Fentities\u002Fdeals\u002Fproducts-get-single)\n- [Get products](\u002Fdocs\u002Fentities\u002Fdeals\u002Fproducts-get)\n- [Add a product](\u002Fdocs\u002Fentities\u002Fdeals\u002Fproducts-add)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","2026-10-14",{},1794739369507]