# PUT /api/v1/inventory/production/runs/{run_id}

> Update production run

- **Tag:** inventory:production
- **Operation ID:** `update_run_api_v1_inventory_production_runs__run_id__put`

## Description

Update run parameters and recalculate costs.

## Authentication

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

## Parameters

- `run_id` (path, string, required)

## Request body

Schema: `RunUpdateRequest`

- `name` (string)
- `total_units` (integer)
- `unit_sale_price` (integer)

## Responses

### 200 — Successful Response

Schema: `RunResponse`

- `id` (string · required)
- `business_id` (string · required)
- `recipe_id` (string · required)
- `name` (string)
- `total_units` (integer · required)
- `unit_sale_price` (integer · required)
- `status` (string · required)
- `cost_snapshot` (CostBreakdown)
- `created_at` (string · required)
- `updated_at` (string · required)

### 400 — Bad Request - Invalid input

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

### 422 — Validation Error - Invalid data format

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/inventory/production/runs/{run_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "total_units": 0,
  "unit_sale_price": 0
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/inventory/production/runs/{run_id}', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "string",
  "total_units": 0,
  "unit_sale_price": 0
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "name": "string",
  "total_units": 0,
  "unit_sale_price": 0
}

response = httpx.put("https://api.ondayzero.com/api/v1/inventory/production/runs/{run_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/inventory-production/update-run
- OpenAPI slice: https://www.ondayzero.com/docs/reference/inventory-production/update-run/openapi.json
- Other endpoints in **inventory:production**: https://www.ondayzero.com/docs/reference/inventory-production
