Set Custom Ingredient Nutrition
Replace a custom ingredient's full nutrient list in one commit — the sent list becomes the complete nutrients array (destructive replace, like setRecipeIngredients). Each nutrient carries its universal physical value (amount/unit) plus a per-market regulatory identity (market_nutrients); amount: null means unknown, never zero. Allowed while the ingredient is draft or active; rejected once archived.
custom_ingredient_id*Custom Ingredient IdIf-Match*stringThe custom ingredient's current version_id: the one the last change to this custom ingredient returned, or the one reading it returns (get_custom_ingredient). A stale value is refused with the current version_id; read the custom ingredient again and retry.
application/json- body
Replace a custom ingredient's full nutrient list.
Full-list replace semantics — the sent list becomes the entity's
complete nutrients. An empty list clears every nutrient.
nutrients*array<>The complete nutrient list — replaces any existing value.
Successful Response
application/json- response
Response for the set-custom-ingredient-nutrition endpoint.
data*A custom ingredient's full data: identity, lifecycle status, serving/nutrition data, and descriptive attributes.
meta*Response metadata.
version_id?|Version committed for this update; pass on a future mutation as If-Match for optimistic concurrency.
curl -X PUT 'https://api.bettermenu.live/studio/custom-ingredients/string/nutrition' \ -H 'If-Match: string' \ -H 'Content-Type: application/json' \ -d '{ "nutrients": [ { "unit": "string" } ]}'{ "data": { "id": "stringstringstringstringst", "org_id": "stringstringstringstrings", "status": "draft", "name": "string", "entry_method": "form", "notes": "string", "reference_amount": "string", "reference_unit": "string", "household_measure": "string", "reference_quantity_g": "string", "density_g_per_ml": "string", "nutrients": [ { "id": "stringstringstringstringst", "unit": "string", "amount": "string", "market_nutrients": { "property1": { "bmid": "string", "nutrient_id": 1 }, "property2": { "bmid": "string", "nutrient_id": 1 } } } ], "approved_markets": [ "US" ], "brand": "string", "manufacturer": "string", "source_url": "string", "attributes": [ { "key": "string", "type": "string", "value": null, "searchable": false } ], "artifacts": [ { "key": "string", "kind": "string", "uploaded_at": "2019-08-24T14:15:22Z" } ], "ingredient_statement": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "meta": { "version": "string", "request_id": "string", "timestamp": "string" }, "version_id": "string"}