# POST /api/v1/inventory/production/recipes/{recipe_id}/duplicate

> Duplicate recipe

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

## Description

Deep-clone a recipe and all its children.

## Authentication

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

## Parameters

- `recipe_id` (path, string, required)

## Responses

### 201 — Successful Response

Schema: `RecipeResponse`

- `id` (string · required)
- `business_id` (string · required)
- `name` (string · required)
- `description` (string)
- `output_unit_name` (string · required)
- `output_unit_weight` (number · required)
- `output_unit_weight_unit` (string · required)
- `conversion_params` (object)
- `materials` (array · RecipeMaterialResponse) → `RecipeMaterialResponse`
  - `category` (string) — Grouping label: raw_material, inclusion, packaging, or other.
  - `name` (string · required) — Material name.
  - `quantity_type` (string · required) — pct_of_weight | fixed_per_unit | per_n_units | fixed_per_run
  - `quantity_value` (number · required) — Numeric quantity parameter.
  - `quantity_unit` (string) — Unit of the quantity value (g, oz, ml, units …).
  - `yield_factor` (number) — Decimal yield 0-1.
  - `cost_per_unit` (integer) — Cost in cents (or whole-currency units for bulk like $/MT).
  - `cost_unit` (string) — Denominator: per_lb, per_kg, per_mt, per_unit, per_oz, per_gal.
  - `position` (integer) — Display ordering.
  - `output_variant_id` (string) — Scope to a specific output variant (for inclusions).
  - `variant_id` (string) — Optional link to an inventory Variant.
  - `vendor_id` (string) — Optional link to a Vendor.
  - `id` (string · required)
  - `recipe_id` (string · required)
- `output_variants` (array · RecipeOutputVariantResponse) → `RecipeOutputVariantResponse`
  - `name` (string · required) — Variant/SKU name.
  - `allocation_pct` (number) — Percentage of the run.
  - `is_remainder` (boolean) — Auto-calc as 100% minus others.
  - `position` (integer)
  - `variant_id` (string) — Optional link to inventory Variant.
  - `id` (string · required)
  - `recipe_id` (string · required)
- `processing_steps` (array · RecipeProcessingStepResponse) → `RecipeProcessingStepResponse`
  - `name` (string · required) — Step / vendor name.
  - `step_type` (string) — Label: Conversion, Co-Packing, Assembly …
  - `allocation_type` (string · required) — pct_of_total | by_output_variant | all_units
  - `allocation_pct` (number) — Percentage if pct_of_total.
  - `cost_per_unit` (integer) — Cost in cents.
  - `cost_unit` (string) — per_lb, per_unit, per_kg …
  - `output_variant_ids` (array · string) — Output variant IDs for by_output_variant.
  - `position` (integer)
  - `vendor_id` (string) — Optional link to Vendor.
  - `id` (string · required)
  - `recipe_id` (string · required)
- `created_at` (string · required)
- `updated_at` (string · required)

### 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 POST 'https://api.ondayzero.com/api/v1/inventory/production/recipes/{recipe_id}/duplicate' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/inventory/production/recipes/{recipe_id}/duplicate', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

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

response = httpx.post("https://api.ondayzero.com/api/v1/inventory/production/recipes/{recipe_id}/duplicate", headers=headers)
data = response.json()
```

## See also

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