
## Update a product of an item

`PATCH /v1/items/:entityTypeId/:id/products/:rowId`

Updates a product row of an item. Pass only the fields you want to change.

## Parameters

| Parameter | Type | Req. | Description |
|----------|-----|:-----:|---------|
| `entityTypeId` (path) | number | yes | Smart-process type ID |
| `id` (path) | number | yes | Item ID |
| `rowId` (path) | number | yes | Product row ID (from the list or add response, not the catalog productId) |

## Request fields (body)

| Parameter | Type | Description |
|----------|-----|---------|
| `price` | number | Price per unit |
| `quantity` | number | Quantity |
| `productId` | number | Product ID. Catalog: `GET /v1/products` |
| `discount` | number | Discount amount |
| `taxRate` | number | Tax rate (%) |
| `taxIncluded` | boolean | Tax included in price |
| `sort` | number | Sort order |

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/items/156/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/items/156/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/items/156/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

The updated product row object: `id`, `productId`, `productName`, `price`, `quantity`, `discount`, `taxRate`, `taxIncluded`.

## Response example

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

## Error response example

404 — row not found:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_DYNAMIC_PARAM` | `entityTypeId` is not a positive integer or is reserved (1, 2, 3, 4, 7, 31) |
| 400 | `INVALID_ROW_ID` | `rowId` is not a positive integer |
| 400 | `INVALID_PARAMS` | Request body is not an object or contains no recognized product-row fields |
| 404 | `ENTITY_NOT_FOUND` | Row not found |
| 403 | `SCOPE_DENIED` | API key does not have the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Get product](/docs/entities/items/products-get-single)
- [Get products](/docs/entities/items/products-get)
- [Add product](/docs/entities/items/products-add)
- [Limits and optimization](/docs/optimization)
