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.
Path Parameters
Serving ID
Header Parameters
Optimistic-concurrency token. Pass the version_id returned by the previous mutation (or by GET /recipes/{id}/versions) so the server can reject the request when another writer has advanced the recipe in the meantime. A stale token (header present but HEAD has moved) surfaces HTTP 409 with the current version_id in the response body. An absent token on a versioned recipe surfaces HTTP 412. Only consumed on API versions that declare the recipe_versioning capability — older versions ignore the header.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
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
},
"racc_inputs": {
"category_id": "string",
"target_audience": "string",
"unit_type": "string",
"unit_weight_g": "string",
"declared_serving_units": 0
},
"dual_column_status": "string",
"has_per_serving_nutrition_facts": true,
"has_per_container_nutrition_facts": true
}
},
"meta": {
"version": "string",
"request_id": "string",
"timestamp": "string"
},
"version_id": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}