# POST /api/v1/inventory/production/runs

> Create production run

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

## Description

Create a new production run from a recipe.  Costs are computed immediately.

## Authentication

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

## Request body

Schema: `RunCreateRequest`

- `recipe_id` (string · required) — Recipe to base the run on.
- `name` (string)
- `total_units` (integer · required) — Number of finished units to produce.
- `unit_sale_price` (integer) — Expected sale price per unit in cents.

## Responses

### 201 — 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 POST 'https://api.ondayzero.com/api/v1/inventory/production/runs' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "recipe_id": "string",
  "total_units": 0
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "recipe_id": "string",
  "total_units": 0
}

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

## See also

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