Skip to content
Skip to Content
Docs
Studio

Open Custom Ingredient Pending Changes

Open pending changes on an active custom ingredient: a copy of its current version that can be edited while every recipe keeps using the current version. Nothing changes for recipes until a person confirms the pending changes. Send the ingredient's current version_id as If-Match. The response's version_id is the newest version of the pending changes. At most one set of pending changes is open per ingredient.

POST
/studio/custom-ingredients/{custom_ingredient_id}/pending-changes

Path Parameters

custom_ingredient_id*Custom Ingredient Id

Header Parameters

If-Match*string

The 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.

Response Body

Successful Response

application/json
  1. response

The open pending changes of a custom ingredient, with their content.

data is the ingredient as it would read with the pending changes applied, and version_id is their newest version. Nothing that uses the ingredient reads this content until a person confirms it.

data*

A custom ingredient's full data: identity, lifecycle status, serving/nutrition data, and descriptive attributes.

meta*

Response metadata.

pending_changes*

The open pending changes of a custom ingredient, without their content.

Pending changes are proposed edits kept beside the ingredient. Recipes, search and the ingredient list keep using the ingredient's current version until a person confirms them. Read their content with getCustomIngredientPendingChanges.

version_id*Version Id

The newest version of the pending changes. Send it as If-Match when editing them.

Match^[0-9A-HJKMNP-TV-Z]{26}$
Example Request
curl -X POST 'https://api.bettermenu.live/studio/custom-ingredients/string/pending-changes' \  -H 'If-Match: string'
Example Response
{  "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"  },  "pending_changes": {    "id": "string",    "state": "open",    "base_version_id": "string",    "tip_version_id": "string",    "origin": "member",    "created_at": "2019-08-24T14:15:22Z",    "created_by": "string",    "last_commit_at": "2019-08-24T14:15:22Z"  },  "version_id": "string"}

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

Start freeNo card needed.