Skip to content
Skip to Content
Docs
Studio

Update Recipe Serving

Replace a serving's size input (full replacement by ID).

Replaces the serving_size input for the specified serving and resolves the new serving_size inline. Atomically recomputes and folds per-serving and per-container nutrition facts into the same Version — always, with no way to opt out, so no follow-up call is needed. A no-op update (same serving size) recomputes nothing and keeps the existing panels.

For racc_guided mode, use searchUsRaccCategories to find the right RACC food category first.

PUT
/studio/recipes/{recipe_id}/servings/{serving_id}

Path Parameters

recipe_id*Recipe Id
serving_id*Serving Id

Serving ID

Header Parameters

If-Match*string

The recipe's current version_id: the one the last change to this recipe returned, or the one reading the recipe returns (get_recipe). A stale value is refused with the current version_id; read the recipe again and retry.

Request Body

application/json
  1. body

Replace a serving on a recipe (PUT semantics — full replacement by serving ID).

Use this when a serving already exists and you need to change its size. Resets computed nutrition facts — call computeNutritionFacts after updating.

serving_size*|

Discriminated union of serving size inputs. Set serving_size_type to user_provided for manual household + metric values, or racc_guided to derive the serving size from a regulatory product category.

rationale?|

Reason for the change (stored in audit trail)

Response Body

Successful Response

application/json
  1. response

Response for updateRecipeServing.

data*

Data payload for update serving response.

meta*

Response metadata.

version_id?|

Version committed for this mutation; pass on the next request as If-Match for optimistic concurrency. Present only on versions declaring the recipe_versioning capability.

Example Request
curl -X PUT 'https://api.bettermenu.live/studio/recipes/string/servings/string' \  -H 'If-Match: string' \  -H 'Content-Type: application/json' \  -d '{  "rationale": "Updated portion weight after production run",  "serving_size": {    "household_amount": "3",    "household_unit": "cookies",    "metric_amount": "42",    "metric_unit": "g",    "serving_size_type": "user_provided"  }}'
Example Response
{  "data": {    "recipe_id": "string",    "serving": {      "id": "string",      "serving_size_type": "string",      "serving_size": {        "household_measure": "string",        "metric_amount": 0,        "metric_unit": "string",        "servings_per_container": 0,        "serving_weight_g": 0      },      "racc_inputs": {        "category_id": "string",        "target_audience": "string",        "unit_type": "string",        "unit_weight_g": "string",        "declared_serving_units": 0,        "sold_individually": true,        "serving_weight_g": "string",        "household_unit_name": "string",        "household_unit_name_plural": "string"      },      "dual_column_status": "string",      "has_per_serving_nutrition_facts": true,      "has_per_container_nutrition_facts": true    },    "reference_amount_changed": {      "previous": {        "amount": "string",        "unit": "string"      },      "current": {        "amount": "string",        "unit": "string"      }    }  },  "meta": {    "version": "string",    "request_id": "string",    "timestamp": "string"  },  "version_id": "string"}

Recipe in, FDA-format Nutrition Facts out, with every version kept.

Start freeNo card needed.