# PUT /api/v1/catalog-items/{bundle_id}/components

> Set a bundle's components

- **Tag:** catalog-items
- **Operation ID:** `set_bundle_components_api_v1_catalog_items__bundle_id__components_put`

## Description

Replace a bundle's component set wholesale.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `bundle_id` (path, string, required)

## Request body

Schema: `BundleComponentsSetRequest`

- `components` (array · BundleComponentInput) → `BundleComponentInput`
  - `component_item_id` (string · required) — Catalog item in the bundle.
  - `qty` (number | string) — Quantity of this component.

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_BundleComponentsResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (BundleComponentsResponse)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/catalog-items/{bundle_id}/components' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "components": []
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/catalog-items/{bundle_id}/components', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "components": []
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "components": []
}

response = httpx.put("https://api.ondayzero.com/api/v1/catalog-items/{bundle_id}/components", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/catalog-items/set-bundle-components
- OpenAPI slice: https://www.ondayzero.com/docs/reference/catalog-items/set-bundle-components/openapi.json
- Other endpoints in **catalog-items**: https://www.ondayzero.com/docs/reference/catalog-items
