Skip to content
Skip to Content
Docs
Studio

Compute Recipe Nutrition

Compute and save total recipe nutrition (batch-level, all ingredients summed).

Use this endpoint to manually trigger a nutrition recompute — typically after an external update to ingredient nutrient data. The recipe must be in ACTIVE state with at least one confirmed ingredient. The response version_id should be passed back as If-Match on the next mutation.

POST
/studio/recipes/{recipe_id}/nutrition/compute

Path Parameters

recipe_id*Recipe 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.

Response Body

Successful Response

application/json
  1. response

Response for computeRecipeNutrition (atomic step).

data*

Data payload for compute nutrition 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 POST 'https://api.bettermenu.live/studio/recipes/string/nutrition/compute' \  -H 'If-Match: string'
Example Response
{  "data": {    "recipe_id": "string",    "nutrition": {      "calculated_at": "string",      "nutrients": [        {          "id": 1,          "bmid": "string",          "name": "string",          "total_amount": 0,          "unit": "string"        }      ],      "reference_weight_grams": 0    }  },  "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.