Merran documentation API & integrations
Undo a shopping substitution
const url = 'http://localhost:3000/api/list/substitutions/undo';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"listId":"0199e8b0-5a10-7a01-8b00-00000000001c","meals":[{"mealId":"0199e8b0-5a10-7a01-8b00-00000000001b","expected":"2026-10-15T18:30:00.000Z","variants":[]}],"library":null,"manual":null}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/list/substitutions/undo \ --header 'Content-Type: application/json' \ --data '{ "listId": "0199e8b0-5a10-7a01-8b00-00000000001c", "meals": [ { "mealId": "0199e8b0-5a10-7a01-8b00-00000000001b", "expected": "2026-10-15T18:30:00.000Z", "variants": [] } ], "library": null, "manual": null }'Signed-in household members only. Restores meal variants and changed quantities if the meals and optional library recipe still match the returned Undo revisions. Bought items are preserved.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Ingredients and instructions saved for one planned meal; the library recipe stays separate. Nutrition must be recalculated for substitutions.
object
object
The line as written.
Example
tablespoonWhat it is to the dish, as tidy up marked it: needed, swappable or optional. A dislike is left out of lines that aren’t needed. None until marked.
Example
{ "id": "0199e8b0-5a10-7a01-8b00-000000000012", "section": null, "text": "1 tbsp olive oil", "quantity": 1, "quantityMax": null, "unit": "tablespoon", "food": "olive oil", "note": null, "mark": "optional"}object
Example
{ "id": "0199e8b0-5a10-7a01-8b00-000000000015", "section": null, "text": "Heat the oven to 425°F."}object
object
An item as it was, to put it back (Undo).
object
How it got on the list: from the plan, typed in, every week, a usual buy, or the assistant.
object
What checking it off put in the pantry, so unchecking takes it back out.
object
The pantry item it went into; null for household things and staples.
It made that pantry item, rather than joining one already there.
It gave an amount to a pantry item that was there with none, so taking it back leaves that item with none again.
object
The purchase it recorded.
Example
{ "id": "0199e8b0-5a10-7a01-8b00-00000000001d", "list": "0199e8b0-5a10-7a01-8b00-00000000001c", "name": "chicken thighs", "foodKey": "chicken thigh", "quantity": 3, "unit": "pound", "amountText": null, "aisle": "0199e8b0-5a10-7a01-8b00-000000000021", "checked": false, "source": "plan", "forMeals": [ { "meal": "0199e8b0-5a10-7a01-8b00-00000000001b", "quantity": 3, "unit": "pound" } ], "putAway": null, "createdAt": "2026-10-15T18:30:00.000Z"}Example
{ "listId": "0199e8b0-5a10-7a01-8b00-00000000001c", "meals": [ { "mealId": "0199e8b0-5a10-7a01-8b00-00000000001b", "expected": "2026-10-15T18:30:00.000Z", "variants": [] } ], "library": null, "manual": null}Responses
Section titled “Responses”Undone.
object
Example
{ "done": true}Not signed in.
object
object
object
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}Not allowed.
object
object
object
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}Item or meal no longer exists.
object
object
object
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}Someone changed it since.
object
object
object
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.