Skip to content
Skip to Content
Docs
Studio

Upsert Recipe Label Configuration

Idempotent create-or-update for recipe label configuration.

Creates if no active label configuration exists; replaces all existing entries otherwise. Sends If-Match: W/"<version_id>" to guard against concurrent writes — returns 412 on conflict.

Leave nutrient_entries out to keep the entries already saved. acknowledged_fills saves the maker's confirmation of nutrients the label prints as a stated zero (see exportRecipeLabelArtifact). Confirmations already saved are kept unless a new one names the same serving and nutrient.

Available only on API versions declaring the recipe_versioning capability.

PUT
/studio/recipes/{recipe_id}/label-configuration

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.

Request Body

application/json
  1. body

PUT request body for idempotent create-or-update.

nutrient_entries?array<>|

Sparse — only nutrients to customize; replaces any existing entries. Leave it out to keep the entries already saved, for example when only saving acknowledged_fills.

acknowledged_fills?array<>|

Confirmations of nutrients the label prints as a stated zero, because no ingredient's source reports a value. Each is added to those already saved for the same serving and nutrient. Leave it out to keep the saved confirmations as they are. Show the nutrients to the person who owns the label before sending them. Refused while label readiness is off, and when a confirmation names a nutrient that is not a stated zero on the current label.

Response Body

Successful Response

application/json
  1. response

Standard response envelope.

data*

Response data envelope.

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 PUT 'https://api.bettermenu.live/studio/recipes/string/label-configuration' \  -H 'If-Match: string' \  -H 'Content-Type: application/json' \  -d '{  "nutrient_entries": [    {      "bmid": "n_vitamin_d",      "visible": true    },    {      "bmid": "n_iron",      "visible": false    }  ]}'
Example Response
{  "data": {    "recipe_id": "string",    "nutrients": [      {        "bmid": "string",        "official_name": "string",        "visible": true,        "display_name": "string",        "display_name_override": "string",        "allowed_synonyms": [          "string"        ],        "is_mandatory": true,        "is_toggleable": true,        "source": "regulatory_default"      }    ],    "has_custom_configuration": true,    "created_by": "string",    "updated_at": "string",    "acknowledged_fills": [      {        "serving_id": "string",        "bmid": "string",        "basis": "string",        "fills_hash": "string",        "acknowledged_by": "string",        "acknowledged_at": "2019-08-24T14:15:22Z",        "channel": "string"      }    ]  },  "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.