---
title: "Save a variation's recipe"
method: POST
path: "/api/public/v1/inventoryRecipes/save"
---

# Save a variation's recipe

`POST /api/public/v1/inventoryRecipes/save`

## Request

- Base URL: `https://app.fortuneos.ai`
- URL: `https://app.fortuneos.ai/api/public/v1/inventoryRecipes/save`
- Auth: none declared

Writes the next recipe revision for the variation: its lines in order, each a product of the organization at most once with a net above zero and a gross no less than it, both integer strings of thousandths of the product's base unit. With portionCount (1 to 1000) the lines are for a batch of that many portions and output is the batch's planned output; without it they are for one portion, with no output. portionNutrition, { calories, proteins, fats, carbs } each at least 0 (kcal, then grams), corrects one portion's figures, which the lines leave cooking out of; a null figure, or portionNutrition left out, keeps the lines'. An empty list clears the recipe, its output and its correction. expectedNumber is the revision the edit started from, 0 for none; a save started from an older revision is refused with CONFLICT as `recipeChanged`, and a product the organization does not hold with NOT_FOUND as `stockNotFound`. Refused with FORBIDDEN as `inventoryDisabled` while the inventory flag is off. The write is refused with BAD_REQUEST as `passItemLocked` for a pass item, whose price and setup change through passes.update. Refused with FORBIDDEN as `paywallLocked` when the caller is an Owner or Manager of a business the merchant Paywall locks: one with no verified subscription that has taken 5 orders while the Paywall's rollout reaches it, an order counting from its first saved line, whether or not it is paid or completed, until it is archived or cancelled before activation. Nothing is read or written; a verified subscription lifts the lock.

## Request body

- object
  - `itemVariationId` string, required
  - `expectedNumber` integer, required
  - `portionCount` integer
  - `output` object, nullable
    - `quantity` string, required
    - `unit` 'g' | 'ml' | 'pcs', required
  - `portionNutrition` object
    - `calories` number, nullable, required
    - `proteins` number, nullable, required
    - `fats` number, nullable, required
    - `carbs` number, nullable, required
  - `lines` object[], required
    - `stockItemId` string, required
    - `net` string, required
    - `gross` string, required

## Response `200`

OK

- object, nullable
  - `number` integer, required
  - `createdAt` string, date-time, required
  - `createdByName` string, nullable, required
  - `portionCount` integer, required
  - `output` object, nullable, required
    - `quantity` string, required
    - `unit` 'g' | 'ml' | 'pcs', required
  - `portionNutrition` object, required
    - `calories` number, nullable, required
    - `proteins` number, nullable, required
    - `fats` number, nullable, required
    - `carbs` number, nullable, required
  - `lines` object[], required
    - `stockItem` object, required
      - `id` string, required
      - `name` string, required
      - `baseUnit` 'g' | 'ml' | 'pcs', required
    - `net` string, required
    - `gross` string, required
    - `batchNet` string, required
    - `batchGross` string, required

## Changes

- **2026-11-13** `60c8c72ea716`: 2 info
  - added the new optional request property `portionNutrition`
  - added the required property `anyOf[subschema #1]/portionNutrition` to the response with the `200` status
- **2026-11-04** `1cfbb66bec32`: 6 info
  - added the new optional request property `output`
  - added the new optional request property `portionCount`
  - added the required property `anyOf[subschema #1]/lines/items/batchGross` to the response with the `200` status
  - added the required property `anyOf[subschema #1]/lines/items/batchNet` to the response with the `200` status
  - …2 more
- **2026-11-04** `fd0a6ac1fd55`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fortis/apis/fortune-os-api/changes/api/public/v1/inventoryRecipes/save/post.md)

---

[API](https://skmtc.dev/fortis/apis/fortune-os-api.md) - [All operations](https://skmtc.dev/fortis/apis/fortune-os-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fortis/apis/fortune-os-api/revisions/522f3cea550d?raw)
