# Answer Several Added Sugars Rows

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

Records your answers for several ingredient rows of the recipe's Added Sugars report in one request and returns the updated report in the same shape as reading it: `data` holds `report`, `report_hash` and `confirmation`, and `version_id` is the new version. Use it when a recipe has more than one row to answer: it saves ONE new version for all of them and rebuilds the report once, where answering row by row saves a version per row and needs a fresh `If-Match` for each.

`items` holds from 1 to 100 answers, each naming a different row by its ingredient row id (`irow_...`) and taking the same fields as answering a single row: `action` (`accept_suggestion`, `set_contribution`, `add_contribution`, `remove_contribution` or `keep`), then for `set_contribution` and `add_contribution` exactly one of `added_sugars_grams` (grams in this row at its current quantity) or `added_sugars_per_100g`, and an optional `reason` and `supplier_reference`.

The answers are saved together or not at all. If any row cannot take its answer, the whole request is refused with 422 `added_sugars_rows_refused`, `rows` names every such row with its reason, and nothing is saved. If the answers together put a row's, the batch's or a serving's added sugars above its total sugars, the request is refused with 422 `added_sugars_exceed_total` naming them, and nothing is saved. If both kinds of fault are in one request, the 422 is `added_sugars_rows_refused` and its `rows` also lists each row that breaks its own total sugars, with `row_code` `added_sugars_exceed_total`, so every bad row is marked in one round. Nothing is ever lowered to fit.

Saving a version ends any earlier confirmation of the report and takes the Added Sugars line off the recipe's nutrition and labels until the new report is confirmed. Send the recipe's current `version_id` in the `If-Match` header.
