Edits an existing ingredient.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Omitted fields in the request will keep their current values.
The archived field
archived fieldarchived – Optional. true archives the ingredient; false unarchives it. If omitted, the ingredient's archive state is left unchanged.
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 objectco2eq_cradle_to_gate_kg is the value Apicbase uses for the ingredient's CO₂ equivalent emissions (reporting, totals, product carbon footprint).
co2eq_cradle_to_gate_kg– CO₂e from raw materials to factory gate (cradle-to-gate). Use this for the ingredient's main carbon footprint value.co2eq_farm_to_farmgate_kg– CO₂e from farm to farm gate only (narrower scope). Optional / for reference.
On 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.
