> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fire.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# Crear receta (borrador)

> Crea una nueva receta en estado DRAFT. Los borradores no afectan los niveles de stock. Publícalos cuando estén listos.

<ParamField header="x-api-key" type="string" required>
  API key de BOH con scope `recipes:write`.
</ParamField>

<ParamField path="vendorId" type="string" required>UUID del vendor.</ParamField>

<ParamField body="name" type="string" required>Nombre de la receta.</ParamField>
<ParamField body="yield_quantity" type="number" required>Cantidad producida por esta receta.</ParamField>
<ParamField body="yield_unit_id" type="string" required>UUID de la unidad de la cantidad producida.</ParamField>
<ParamField body="product_id" type="string">UUID del producto del menú al que se vincula esta receta.</ParamField>
<ParamField body="external_product_id" type="string">ID externo del producto del menú.</ParamField>

<ParamField body="ingredients" type="object[]">
  Lista de ingredientes.

  <Expandable title="campos del ingrediente">
    <ParamField body="item_id" type="string">UUID del artículo.</ParamField>
    <ParamField body="external_item_id" type="string">ID externo del artículo.</ParamField>
    <ParamField body="recipe_id" type="string">UUID de sub-receta (en lugar de artículo).</ParamField>
    <ParamField body="quantity" type="number" required>Cantidad del ingrediente.</ParamField>
    <ParamField body="unit_id" type="string" required>UUID de la unidad del ingrediente.</ParamField>
    <ParamField body="waste_factor" type="number">Factor de merma (0–1, default 0).</ParamField>
    <ParamField body="notes" type="string">Notas de preparación.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="external_user_id" type="string">Actor para auditoría.</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "name": "Salsa de Tomate",
    "yield_quantity": 1,
    "yield_unit_id": "unit_lt_01...",
    "ingredients": [
      {
        "external_item_id": "tomate-bola",
        "quantity": 0.8,
        "unit_id": "unit_kg_01..."
      }
    ]
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "rec_01...",
    "name": "Salsa de Tomate",
    "status": "DRAFT",
    "yield_quantity": 1,
    "yield_unit_id": "unit_lt_01..."
  }
  ```
</ResponseExample>
