Skip to content
merran
GitHubInstall

Merran documentation API & integrations

Say what ran out cooking a meal

POST
/api/pantry/ran-out
curl --request POST \
--url http://localhost:3000/api/pantry/ran-out \
--header 'Content-Type: application/json' \
--cookie merran.session_token=<merran.session_token> \
--data '{ "meal": "0199e8b0-5a10-7a01-8b00-00000000001b", "foods": [ "chicken thigh" ], "list": true }'

Only for a meal that’s cooked. Everything of each food at home is used up, except what’s in the freezer, unless cooking the meal took that food from the freezer. With list, each goes on the list as a plain line for no meal, unless it, or a kind of it, is on already: always-on-hand foods too. What the meal took when it was cooked stays as it was, so marking it not cooked later doesn’t bring back what ran out. It takes the pantry permission, though it adds to the list. With an API key, it needs the pantry: write permission.

Media typeapplication/json
object
meal
required

The cooked meal.

string format: uuid
foods
required

Foods that ran out, from what could have. Others are passed over.

Array<string>
<= 100 items
list
required

Put them on the list too, as plain lines for no meal, unless they’re on it already.

boolean

Example

{
"meal": "0199e8b0-5a10-7a01-8b00-00000000001b",
"foods": [
"chicken thigh"
],
"list": true
}

Used up, and listed.

Media typeapplication/json
object
usedUp
required

What was used up, as it was: for Undo with /pantry/restore.

Array<object>

Something at home as it was, to put it back (Undo).

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

Where it’s kept.

string | null
Allowed values: fridge freezer cupboard
useBy
required
string | null
/^\d{4}-\d{2}-\d{2}$/
forMeals
required
Array<object> | null
<= 100 items
object
meal
required
string
quantity
required
number | null
unit
required
string | null
counted

How much of it was counted on when the meal went on the list, keeping that much off the list.

object
quantity
required
number | null
unit
required
string | null
createdAt
required
string format: date-time
listed
required

What went on the list: for Undo, their ids go in /list/restore’s remove.

Array<object>
object
id
required
string
list
required

The list it’s on.

string
name
required
string
amount
required

How much, as it shows: “1 ½ cups”, “half a bag”, or empty.

string
quantity
required
number | null
unit
required

A unit id, like “cup” or “pound”; null for a count.

string | null
amountText
required

An amount in words (“half a bag”), when it isn’t a number.

string | null
aisle
required

Its aisle’s id.

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
meals
required

The planned meals it’s for.

Array<object>
object
id
required
string
name
required
string
createdAt
required
string format: date-time

Example

{
"usedUp": [
{
"id": "0199e8b0-5a10-7a01-8b00-000000000026",
"name": "chicken thighs",
"foodKey": "chicken thigh",
"quantity": 1,
"unit": "pound",
"amountText": null,
"aisle": "0199e8b0-5a10-7a01-8b00-000000000021",
"storedIn": "fridge",
"useBy": "2026-10-18",
"forMeals": null,
"createdAt": "2026-10-15T18:30:00.000Z"
}
],
"listed": []
}

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."
}
}
}

No such meal.

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."
}
}
}

The meal isn’t cooked.

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.