
## Add a product to a smart-process item

`POST /v1/items/:entityTypeId/:id/products`

Adds a single product row to a smart-process item. Unlike `PUT /v1/items/:entityTypeId/:id/products`, it does not replace existing rows.

## Request fields (body)

| Parameter | Type | Req. | Description |
|----------|-----|:-----:|---------|
| `entityTypeId` (path) | number | yes | Smart-process type ID |
| `id` (path) | number | yes | Item ID |
| `productId` | number | no | Catalog product ID. If set without `productName`, the name is taken from the catalog. Catalog: `GET /v1/products` |
| `productName` | string | no | Product row name — for a custom row without a catalog product. Provide at least one of `productId` / `productName`. |
| `price` | number | no | Price per unit |
| `quantity` | number | no | Quantity |
| `discount` | number | no | Discount amount |
| `taxRate` | number | no | Tax rate (%) |
| `taxIncluded` | boolean | no | Tax included in price |

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/items/180/47/products" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "productId": 1, "price": 25000, "quantity": 2 }'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/items/180/47/products" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "productId": 1, "price": 25000, "quantity": 2 }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/items/180/47/products', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ productId: 1, price: 25000, quantity: 2 }),
})

const { success, data } = await res.json()
console.log('Row ID:', data.id)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/items/180/47/products', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ productId: 1, price: 25000, quantity: 2 }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `data` | object | The created product row in full, HTTP status `201`. Field set — [Product fields](/docs/entities/items/products-fields) |

## Response example

Main fields are shown. Full list — [Product fields](/docs/entities/items/products-fields).

```json
{
  "success": true,
  "data": {
    "id": 1465,
    "productId": 1,
    "productName": "Server hardware",
    "price": 25000,
    "quantity": 2,
    "discount": 0,
    "discountTypeId": 2,
    "taxIncluded": false
  }
}
```

## Error response example

404 — item 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_PARAMS` | Request body is not an object or contains no recognized product-row fields |
| 404 | `ENTITY_NOT_FOUND` | Item 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

- [Product rows](/docs/entities/items/products-get)
- [Set products](/docs/entities/items/products-set)
- [Delete product](/docs/entities/items/products-delete)
- [Catalog products](/docs/entities/products)
