Skip to content
merran
GitHubInstall

Merran documentation API & integrations

Undo a shopping substitution

POST
/api/list/substitutions/undo
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.

Media typeapplication/json
object
listId
string
meals
required
Array<object>
<= 100 items
object
mealId
required
string
expected
required
string
variants
required
Array<object>

Ingredients and instructions saved for one planned meal; the library recipe stays separate. Nutrition must be recalculated for substitutions.

object
recipeId
required
string
name
required
string
<= 500 characters
servings
required
number | null
> 0
basedOn
required
string
needs
required
Array<string>
<= 100 items
ingredients
required
Array
<= 500 items
object
id
required
string
section
required
string | null
text
required

The line as written.

string
quantity
required
number | null
quantityMax
required
number | null
unit
required
string | null

Example

tablespoon
food
required
string | null
note
required
string | null
mark
required

What 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.

string | null
Allowed values: needed swappable optional
foodKey
string | null

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"
}
steps
required
Array<object>
<= 500 items
object
id
required
string
section
required
string | null
text
required
string

Example

{
"id": "0199e8b0-5a10-7a01-8b00-000000000015",
"section": null,
"text": "Heat the oven to 425°F."
}
library
required
object
recipeId
required
string
versionId
required
string
expected
required
string
manual
required
object
snapshot
required

An item as it was, to put it back (Undo).

object
id
required
string
list
required
string
name
required
string
>= 1 characters <= 200 characters
foodKey
required
string | null
<= 200 characters
quantity
required
number | null
unit
required
string | null
<= 40 characters
amountText
required
string | null
<= 60 characters
aisle
required
string | null
checked
required
boolean
source
required

How it got on the list: from the plan, typed in, every week, a usual buy, or the assistant.

string
Allowed values: plan typed every-week usual assistant
forMeals
required
Array<object> | null
<= 100 items
object
meal
required
string
quantity
required
number | null
unit
required
string | null
putAway

What checking it off put in the pantry, so unchecking takes it back out.

object
pantryItem
required

The pantry item it went into; null for household things and staples.

string | null format: uuid
quantity
required
number | null
unit
required
string | null
<= 40 characters
amountText
required
string | null
<= 60 characters
created
required

It made that pantry item, rather than joining one already there.

boolean
filledEmpty

It gave an amount to a pantry item that was there with none, so taking it back leaves that item with none again.

boolean
forMeals
required
Array<object>
<= 100 items
object
meal
required
string
quantity
required
number | null
unit
required
string | null
purchase
required

The purchase it recorded.

string format: uuid
lookedOverAt
required
string | null format: date-time
createdAt
required
string format: date-time

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"
}
expected
required
string

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
}

Undone.

Media typeapplication/json
object
done
required
boolean

Example

{
"done": true
}

Not signed in.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Not allowed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Item or meal no longer exists.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Someone changed it since.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

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.