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.
recipe_id*Recipe Idserving_id*Serving IdServing ID
If-Match*stringThe 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.
application/json- 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)
Successful Response
application/json- 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.
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" }}'{ "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"}