Skip to content
Skip to Content
Docs
Studio

Start Ingredient Resolution

Starts a new ingredient resolution. Resolves ingredient items into matched food items and gram weights. Each item declares an action (add_ingredient, keep_ingredient, replace_ingredient, update_ingredient_text, update_ingredient_name, update_ingredient_quantity, update_ingredient_grams, or remove_ingredient). Returns resolved rows with search candidates and unit conversions. Check summary.ready_to_confirm — if true, call confirmIngredients. No Version is committed.

You are charged for the ingredient lines a model actually works on, on a first resolution and on a re-analysis alike: a line whose text is newly added or changed is parsed afresh and is charged, while lines you keep or remove, and lines that arrive already matched with a gram weight, need no model and are not charged. Lines beyond your plan's included monthly allowance are billed at your plan's metered rate. Manage your plan and usage in BetterMenu Studio.

POST
/studio/recipes/{recipe_id}/ingredient-resolutions

Path Parameters

recipe_id*Recipe Id

Request Body

application/json
  1. body

Request body for POST /recipes/{id}/ingredients/resolve.

items*array<|||||||>

Ordered manifest of all ingredient rows.

Items1 <= items <= 50
previous_resolution_id?|

The resolution_id from a prior resolveIngredients response. Required when any item uses keep_ingredient, update_*, replace_ingredient, or remove_ingredient.

Response Body

Successful Response

application/json
  1. response

Response envelope for resolve and resolution read endpoints.

data*

Response from POST /resolve, GET /latest-resolution, GET /resolutions.

meta*

Response metadata.

Example Request
curl -X POST 'https://api.bettermenu.live/studio/recipes/string/ingredient-resolutions' \  -H 'Content-Type: application/json' \  -d '{  "items": [    {      "action": "add_ingredient",      "text": "1 cup all-purpose flour"    },    {      "action": "add_ingredient",      "text": "2 tbsp olive oil"    }  ]}'
Example Response
{  "data": {    "resolution_id": "string",    "previous_resolution_id": "string",    "recipe_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "summary": {      "total": 0,      "resolved": 0,      "unresolved": 0,      "ready_to_confirm": true    },    "rows": [      {        "row_id": "string",        "position": 0,        "original_text": "string",        "parsed": {          "position": 0,          "original_text": "string",          "quantity": "string",          "quantity_text": "string",          "unit": "string",          "ingredient_name": "string",          "preparation": "string",          "quantity_range": [            "string",            "string"          ],          "error": {            "message": "string",            "field": "string"          }        },        "search": {          "ingredient_id": "string",          "ingredient_name": "string",          "provenance": "system_matched",          "is_branded": false,          "candidates": [            {              "ingredient_id": "string",              "name": "string",              "item_type": "ingredient",              "category": "string",              "preparation": "string",              "food_form": "string",              "relevance_score": 0,              "nutrient_count": 0,              "portion_count": 0,              "food_portions": [                {                  "id": "string",                  "amount": "string",                  "unit_name": "string",                  "modifier": "string",                  "gram_weight": "string"                }              ],              "nutrients": [                {                  "id": "n_qr2jbh18w4hmo",                  "name": "protein",                  "amount": "string",                  "unit": "g"                }              ]            }          ]        },        "unit_conversion": {          "quantity_grams": "string",          "provenance": "identity",          "conversion_class": "string",          "steps": [            {              "input_quantity": "string",              "input_unit": "string",              "output_quantity": "string",              "output_unit": "string",              "source": "identity",              "conversion_class": "string",              "reasoning": "string"            }          ]        }      }    ]  },  "meta": {    "version": "string",    "request_id": "string",    "timestamp": "string"  }}

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

Start freeNo card needed.