Edits an existing ingredient.
Omitted fields in the request will keep their current values.
The nutrition_info
object
nutrition_info
objectOn PATCH, if the for_weight_qty
and for_weight_unit
fields are null
, their current values will be preserved.
The carbon_footprint
object
carbon_footprint
objectOn PATCH, you can delete field values by setting them to null
The stock_variants
array
stock_variants
arrayThis attribute accepts an array of ingredient IDs, to be set as stock variants for the ingredient being edited.
When this field is included in a request, the current variants are replaced by the variants specified in the array.
Example: consider an ingredient that has variants with IDs 1, 2 and 3. Sending a PATCH request with the following arrays in the stock_variants
attribute will have the respective effects:
stock_variants: [1, 2, 3, 4]
– Ingredient with ID 4 will be added as a stock variant.stock_variants: [4]
– Ingredients with ID 1, 2 and 3 will be removed as stock variants, while the ingredient with ID 4 will be added.stock_variants: [1, 3]
– Only the ingredient with ID 2 will be removed as a stock variant.stock_variants: []
– All ingredients will be removed as stock variants.
Omitting this field in the request keeps the current list of stock variants unchanged.