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

# Recipes

> Create recipes, use sub-recipes, calculate ingredient needs, and deduct stock from POS sales

# Recipes

Recipes connect kitchen operations with inventory control.

Use recipes to standardize dishes, calculate ingredient needs, reuse prep recipes, calculate cost per portion, and deduct stock when POS sales are processed.

<CardGroup cols={3}>
  <Card title="Build recipe structures" icon="book-open">
    Add ingredients and sub-recipes to define how a dish or preparation is made.
  </Card>

  <Card title="Calculate usage" icon="calculator">
    Calculate ingredient needs, trim, cost per portion, and producible portions.
  </Card>

  <Card title="Connect POS sales" icon="cash-register">
    Map POS items to recipes so sales can deduct ingredient stock automatically.
  </Card>
</CardGroup>

## Creating a recipe

Go to **Manage** → **Recipes** and click **Add new recipe**.

A recipe can contain ingredients, sub-recipes, quantities, trim percentages, and storage rules.

<Steps>
  <Step title="Create missing ingredients">
    Make sure all required ingredients exist in the ingredient master list.
  </Step>

  <Step title="Open Recipes">
    Go to **Manage** → **Recipes**.
  </Step>

  <Step title="Create a new recipe">
    Click **Add new recipe**.
  </Step>

  <Step title="Enter recipe details">
    Add the recipe name and optionally set a default issue storage.
  </Step>

  <Step title="Add recipe lines">
    Add ingredient lines and sub-recipe lines.
  </Step>

  <Step title="Save the recipe">
    Click **Create** to save the recipe.
  </Step>
</Steps>

## Recipe structure

A recipe can contain:

| Field                 | Description                                    |
| --------------------- | ---------------------------------------------- |
| Name                  | The recipe name — required                     |
| Default issue storage | Optional fallback storage for the whole recipe |
| Ingredient lines      | Ingredients from your ingredient master list   |
| Sub-recipe lines      | Other recipes used inside this recipe          |

## Recipe lines

Each recipe line is added one at a time using the **Add line** section at the bottom of the form sheet.

Use the **Line type** toggle to choose between:

| Line type  | Meaning                                |
| ---------- | -------------------------------------- |
| Ingredient | A direct ingredient used in the recipe |
| Recipe     | Another recipe used as a sub-recipe    |

A line contains either an ingredient or a sub-recipe — not both.

## Adding ingredient lines

When adding an ingredient line:

1. Select the **Ingredient** from your ingredient master list
2. Enter the **Qty per portion** — the quantity needed for one portion
3. Enter the **Trim %** — preparation loss percentage, optional and defaults to `0`
4. Select an **Issue storage** — optional, defaults to the recipe's default storage
5. Click **Add line**

The quantity per portion is required and must be greater than `0`.

### Example ingredient lines

| Ingredient  | Qty per portion | Trim |
| ----------- | --------------: | ---: |
| Tomatoes    |        0.200 kg |   0% |
| Mozzarella  |        0.125 kg |   0% |
| Beef fillet |        0.250 kg |  10% |
| Basil       |        0.005 kg |   0% |

## Trim percentage

Trim is used when more stock is needed than the usable quantity in the recipe.

Examples:

* Peeling vegetables
* Trimming meat
* Cleaning fish
* Removing stems
* Cooking or preparation loss

Mathership stores trim as a decimal internally. If you enter a whole number like `10`, it is treated as `10%`.

Formula used for ingredient needs:

**Required quantity = quantity per portion / (1 - trim percentage)**

| Qty per portion | Trim | Actual deducted quantity |
| --------------: | ---: | -----------------------: |
|         1.00 kg |  10% |                  1.11 kg |
|         1.00 kg |  20% |                  1.25 kg |
|         0.50 kg |  10% |                  0.56 kg |

### Trim entry reference

| Entered value | Meaning |
| ------------: | ------- |
|            10 | 10%     |
|          0.10 | 10%     |
|            20 | 20%     |
|          0.20 | 20%     |

## Sub-recipes

Recipes can include other recipes.

Use sub-recipes for preparations that are reused in several dishes.

When adding a sub-recipe line:

1. Select **Line type** → **Recipe**
2. Select the recipe from your recipe list
3. Enter the **Portions** — how many portions of the sub-recipe are used
4. Click **Add line**

The current recipe is excluded from the picker to prevent direct cycles.

### Examples

| Sub-recipe        | Used in                 |
| ----------------- | ----------------------- |
| Pizza dough       | Pizza Margherita        |
| Burger sauce      | Burger Classic          |
| Caesar dressing   | Caesar Salad            |
| Tomato sauce base | Pasta and pizza recipes |

When a recipe uses a sub-recipe, Mathership expands the sub-recipe and calculates all ingredient needs from the lower-level recipe.

## Sub-recipe portions

When adding a sub-recipe, you define how many portions of the sub-recipe are used in the parent recipe.

| Main recipe      | Sub-recipe   | Child portions |
| ---------------- | ------------ | -------------: |
| Burger Classic   | Burger sauce |              1 |
| Pizza Margherita | Pizza dough  |              1 |
| Sharing platter  | Dip recipe   |              3 |

Mathership multiplies the sub-recipe by the number of child portions needed.

## Recipe cycles

A recipe should not contain itself, directly or indirectly.

Invalid example:

| Recipe  | Contains |
| ------- | -------- |
| Sauce A | Sauce B  |
| Sauce B | Sauce A  |

The recipe picker excludes the current recipe when editing to prevent direct self-reference.

If a cycle is detected during POS deduction, Mathership stops that expansion and creates an exception.

<Warning>
  Avoid circular recipe structures. They can prevent recipe expansion and create POS processing exceptions.
</Warning>

## Editing a recipe

You can update:

* Name
* Default issue storage
* Ingredient lines
* Sub-recipe lines
* Quantities
* Trim percentages
* Issue storage per line

<Steps>
  <Step title="Open the recipe">
    Go to **Manage** → **Recipes** and click the recipe.
  </Step>

  <Step title="Click Edit">
    Open the recipe form.
  </Step>

  <Step title="Update the recipe">
    Change the recipe details, lines, quantities, trim, or storage rules.
  </Step>

  <Step title="Save changes">
    Save the recipe and review the detail page.
  </Step>
</Steps>

## Deleting a recipe

Only delete a recipe when it is no longer needed.

A recipe may not be deletable if it is used as a sub-recipe in another recipe.

Open the **Used in recipes** section on the recipe detail page to find parent recipes that contain it.

<Warning>
  Deleting a recipe does not automatically correct past inventory movements or POS deductions.
</Warning>

## Recipe detail page

Opening a recipe shows a full view of the recipe with live stock and costing data.

### Header

The header shows the recipe name and an active or inactive badge.

Click **Edit** to update the recipe.

### Meta strip

Below the header, the meta strip shows:

* Default issue storage — the fallback storage for deductions
* Aggregated allergens — allergens collected from all ingredient lines across the recipe
* Created date

### Stats

Four stat cards show live data:

| Stat           | Description                                                                                                      |
| -------------- | ---------------------------------------------------------------------------------------------------------------- |
| Cost / portion | Total cost per portion based on ingredient unit costs. Shows a warning if some ingredients have no cost data.    |
| Max portions   | Maximum number of portions producible from current stock. Shows the bottleneck ingredient name when this is `0`. |
| Recipe lines   | Total number of lines, with a breakdown of ingredient lines vs sub-recipe lines                                  |
| Updated        | When the recipe was last updated                                                                                 |

### Health warnings

If any of the following are detected, a warning banner appears:

* Recipe uses inactive ingredients
* One or more ingredients are not mapped to a vendor product

Ingredients without product mappings cannot be received through orders.

## Recipe lines table

The recipe lines table shows all ingredients and sub-recipes.

| Column          | Description                                                                                                                                      |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Ingredient      | Ingredient name or sub-recipe name with type icon. Warning icon if not mapped to a vendor product. Inactive badge if the ingredient is inactive. |
| Qty per portion | Amount needed per portion in the ingredient's base unit                                                                                          |
| Trim            | Trim percentage applied to this line                                                                                                             |
| Effective       | Actual quantity deducted after applying trim                                                                                                     |
| Unit cost       | Current weighted average cost per unit                                                                                                           |
| Line cost       | Qty per portion × unit cost                                                                                                                      |
| On hand         | Current stock in the selected storage scope                                                                                                      |
| Portions        | How many portions can be made from current on-hand stock for this line                                                                           |

### Storage scope selector

In the top right of the recipe lines section, choose a specific storage unit or **All storages** to see stock and portions data scoped to that location.

This is useful when the same ingredient is spread across multiple storage units.

Click any ingredient row to go to the ingredient detail page.

Click any sub-recipe row to go to that recipe's detail page.

## Used in recipes

If this recipe is used as a sub-recipe in other recipes, a **Used in recipes** section shows those parent recipes.

Click any row to open the parent recipe.

## POS mappings

If this recipe is connected to POS items, a **POS mappings** section shows all active connections.

| Column        | Description                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------------- |
| Integration   | The POS integration name and type                                                                 |
| POS item name | The item name in the POS system                                                                   |
| Quantity      | The portion multiplier                                                                            |
| Effect        | Addition, where stock is reduced, or Subtraction, where stock is added back for removal modifiers |

## Connecting recipes to POS items

Recipes can be mapped to POS items.

This allows Mathership to deduct ingredients automatically when POS sales are processed.

| POS item         | Recipe                  |
| ---------------- | ----------------------- |
| Pizza Margherita | Pizza Margherita recipe |
| Burger Classic   | Burger Classic recipe   |
| Caesar Salad     | Caesar Salad recipe     |

When the POS item is sold, Mathership multiplies the recipe quantities by the number of portions sold.

See [POS Integrations](/en/restaurants/integrations/overview) for setup details.

## POS deduction example

Recipe:

| Ingredient   | Qty per portion |
| ------------ | --------------: |
| Beef patty   |        0.180 kg |
| Burger bun   |         1 piece |
| Burger sauce |        0.030 kg |

If 10 burgers are sold, Mathership deducts:

| Ingredient   | Deducted quantity |
| ------------ | ----------------: |
| Beef patty   |          1.800 kg |
| Burger bun   |         10 pieces |
| Burger sauce |          0.300 kg |

If trim is used, the deducted quantity is increased automatically.

## Portion multipliers

POS mappings can use a portion multiplier.

This is useful when one POS item represents more or less than one recipe portion.

| POS item           | Recipe           | Portion multiplier |
| ------------------ | ---------------- | -----------------: |
| Pizza Margherita   | Pizza Margherita |                  1 |
| Half portion pasta | Pasta recipe     |                0.5 |
| Sharing platter    | Platter recipe   |                  2 |

## Direct ingredient POS mapping

A POS item can also be mapped directly to an ingredient instead of a recipe.

This is useful for simple items that do not need a full recipe.

| POS item        | Direct mapping          |
| --------------- | ----------------------- |
| Bottle of water | Water bottle ingredient |
| Packaged snack  | Snack ingredient        |

## Storage selection for deduction

When Mathership deducts stock from a recipe sale, it tries to find the storage location in this order:

1. Issue storage on the recipe line
2. Preferred issue storage on the ingredient
3. Default issue storage on the recipe
4. Storage unit with available stock
5. First available storage unit as fallback

If no storage can be found, Mathership creates an exception.

## Inventory movements created by recipes

When POS sales are processed, Mathership creates inventory ledger entries.

Recipe deductions are posted as:

| Transaction type | Meaning                                    |
| ---------------- | ------------------------------------------ |
| `ISSUE`          | Ingredient stock deducted because of sales |

The value of the deduction is calculated using the weighted average cost of the ingredient.

## Weighted average cost

Mathership uses receipt entries to calculate the weighted average cost of an ingredient.

This cost is used when recipe deductions, waste, transfers, or stock adjustments create inventory values.

If no receipt cost exists yet, the cost may be treated as zero. This is shown as a warning on the recipe detail page when ingredients are missing cost data.

## Exceptions during POS processing

POS processing can create exceptions when something is missing or inconsistent.

| Exception         | Meaning                                                 |
| ----------------- | ------------------------------------------------------- |
| Unmapped POS item | The POS item is not connected to a recipe or ingredient |
| Unmapped POS code | The uploaded POS code has no mapping                    |
| No issue storage  | Mathership could not find a storage location            |
| Recipe cycle      | A recipe includes itself directly or indirectly         |
| Negative stock    | The deduction would reduce stock below zero             |

Negative stock does not always stop posting. It is reported as an exception so the issue can be reviewed.

## Recipe reports

Recipes can be used in inventory reporting.

Inventory reports can be filtered by:

| Filter              | Purpose                                                 |
| ------------------- | ------------------------------------------------------- |
| Ingredient          | Show movements for selected ingredients                 |
| Storage unit        | Show movements by storage                               |
| Recipe              | Analyze recipe-related usage                            |
| Date range          | Limit the reporting period                              |
| Transaction type    | Show receipts, issues, waste, transfers, or adjustments |
| Activity            | Show only items with activity                           |
| Current stock range | Filter by current stock level                           |

## Recipe costing

The recipe detail page shows **Cost per portion**, calculated from the current weighted average cost of each ingredient.

If some ingredients have no receipt cost yet, the missing count is shown as a hint below the cost card.

Mathership can support:

* Ingredient usage calculation
* Stock value deduction
* COGS reporting from `ISSUE` movements
* Recipe-related inventory analysis

The more accurate your ingredients, units, and receipt prices are, the more useful your recipe costing becomes.

## Best practices

<CardGroup cols={2}>
  <Card title="Use clear names" icon="tag">
    Use clear recipe names such as **Pizza - Margherita**, **Burger - Classic**, or **Prep - Tomato Sauce Base**.
  </Card>

  <Card title="Create prep recipes" icon="bowl-food">
    Create reusable prep recipes for doughs, sauces, dressings, stocks, marinades, and bases.
  </Card>

  <Card title="Keep units consistent" icon="scale-balanced">
    Use stable ingredient base units, such as kg for flour and beef, L for milk, and piece for eggs.
  </Card>

  <Card title="Use trim carefully" icon="percent">
    Use trim only when stock usage should be higher than the usable recipe quantity.
  </Card>

  <Card title="Set storage rules clearly" icon="warehouse">
    Use issue storage, preferred issue storage, and default issue storage to control where deductions come from.
  </Card>

  <Card title="Review POS mappings" icon="cash-register">
    Before using automatic deductions, check that all relevant POS items are mapped.
  </Card>

  <Card title="Watch max portions" icon="chart-simple">
    Use the Max portions card to see whether current stock can cover upcoming service.
  </Card>

  <Card title="Review missing costs" icon="euro-sign">
    Missing receipt costs can cause cost per portion to show as zero or incomplete.
  </Card>
</CardGroup>

### Good recipe names

* Pizza - Margherita
* Burger - Classic
* Sauce - Burger Sauce
* Dressing - Caesar
* Prep - Tomato Sauce Base

Avoid vague names such as **Sauce**, **Mix**, **Test**, or **Recipe 1**.

### Recommended ingredient units

| Ingredient | Recommended base unit |
| ---------- | --------------------- |
| Flour      | kg                    |
| Milk       | L                     |
| Eggs       | piece                 |
| Beef       | kg                    |
| Herbs      | kg or g               |

### Storage rule order

1. Set issue storage on recipe lines for ingredients that always come from a specific place
2. Set preferred issue storage on ingredients used consistently from one storage
3. Set default issue storage on recipes where most ingredients come from one storage

## Common workflows

### Create a new menu recipe

1. Create missing ingredients in the ingredient master list
2. Go to **Manage** → **Recipes** and click **Add new recipe**
3. Enter the recipe name
4. Set a default issue storage if all ingredients come from the same place
5. Add ingredient lines with quantities and trim percentages
6. Add sub-recipes if needed
7. Click **Create**
8. Map the recipe to the POS item
9. Test with a small POS sale

### Create a prep recipe

1. Go to **Manage** → **Recipes** and click **Add new recipe**
2. Create the prep recipe with all its ingredients
3. Save it
4. Open a final recipe and add the prep recipe as a sub-recipe line

### Update a recipe

1. Open the recipe
2. Click **Edit**
3. Update quantities, trim, ingredients, or sub-recipes
4. Save the recipe
5. Review POS mappings if the recipe changed significantly

### Process POS sales

1. Make sure POS items are mapped to recipes
2. POS sales are synced or imported through the active integration
3. Mathership expands recipes into ingredient needs
4. Stock is deducted from the selected storage units
5. Review exceptions if any are returned

## Troubleshooting

<AccordionGroup>
  <Accordion title="Ingredient is not available">
    Check that the ingredient exists in the ingredient master list and belongs to the correct company.
  </Accordion>

  <Accordion title="Sub-recipe is not available">
    Check that the sub-recipe exists, belongs to the same company, and is active.

    Inactive recipes cannot be used as sub-recipes.
  </Accordion>

  <Accordion title="Recipe is not saving">
    Check that the name is filled in and that at least one line has been added.

    Lines require a valid quantity greater than zero.
  </Accordion>

  <Accordion title="Deducted quantity looks too high">
    Check the trim percentage.

    | Entered trim | Meaning |
    | -----------: | ------- |
    |           10 | 10%     |
    |         0.10 | 10%     |
    |           20 | 20%     |
    |         0.20 | 20%     |
  </Accordion>

  <Accordion title="Stock is not deducted">
    Check that:

    * The POS item is mapped
    * The recipe has ingredient lines
    * The recipe is active
    * A storage location can be found
    * The ingredient exists
    * There is no recipe cycle
  </Accordion>

  <Accordion title="Recipe cannot be deleted">
    The recipe is probably used as a sub-recipe in another recipe.

    Open the **Used in recipes** section on the recipe detail page to find which parent recipes contain it. Remove it from those recipes first.
  </Accordion>

  <Accordion title="POS upload returns exceptions">
    Review the exception list.

    Most issues are caused by missing POS mappings, missing storage rules, or recipe cycles.
  </Accordion>

  <Accordion title="Cost per portion shows 0 or is missing">
    Check that ingredients have been received with a product price.

    Mathership calculates cost from receipt ledger entries. If ingredients have never been received, the weighted average cost will be zero.
  </Accordion>

  <Accordion title="Max portions shows 0 unexpectedly">
    Check the bottleneck ingredient shown in the Max portions card.

    That ingredient is out of stock or has insufficient quantity for even one portion. Open the ingredient detail page to review current stock and recent movements.
  </Accordion>
</AccordionGroup>

## Summary

Recipes are the link between kitchen operations and inventory control.

They help you:

* Standardize dishes
* Reuse prep recipes
* Calculate ingredient needs
* Deduct stock from POS sales
* Improve inventory accuracy
* Support food cost and COGS analysis
* Monitor producible portions from current stock

## Related Articles

<CardGroup cols={2}>
  <Card title="Ingredients" icon="carrot" href="/en/restaurants/inventory/ingredients">
    Manage the ingredient master list used in recipes, receiving, and stock tracking.
  </Card>

  <Card title="Storage Units" icon="warehouse" href="/en/restaurants/inventory/storage-units">
    Manage the storage locations used for recipe deductions and inventory movements.
  </Card>

  <Card title="Product Mapping" icon="link" href="/en/restaurants/inventory/product-mapping">
    Connect vendor products to internal ingredients and conversion factors.
  </Card>

  <Card title="Receiving Orders" icon="truck-ramp-box" href="/en/restaurants/inventory/receiving-orders">
    Receive vendor orders and post mapped products into inventory.
  </Card>

  <Card title="POS Integrations" icon="cash-register" href="/en/restaurants/integrations/overview">
    Connect POS sales to recipes so ingredients can be deducted automatically.
  </Card>

  <Card title="Inventory Reports" icon="chart-line" href="/en/restaurants/reports/inventory-report">
    Analyze stock, recipe usage, movement history, costs, and ingredient activity.
  </Card>
</CardGroup>
