Merran documentation API & integrations
Say what ran out cooking a meal
const url = 'http://localhost:3000/api/pantry/ran-out';const options = { method: 'POST', headers: { cookie: 'merran.session_token=<merran.session_token>', 'Content-Type': 'application/json' }, body: '{"meal":"0199e8b0-5a10-7a01-8b00-00000000001b","foods":["chicken thigh"],"list":true}'};
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/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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The cooked meal.
Foods that ran out, from what could have. Others are passed over.
Put them on the list too, as plain lines for no meal, unless they’re on it already.
Example
{ "meal": "0199e8b0-5a10-7a01-8b00-00000000001b", "foods": [ "chicken thigh" ], "list": true}Responses
Section titled “Responses”Used up, and listed.
object
What was used up, as it was: for Undo with /pantry/restore.
Something at home as it was, to put it back (Undo).
object
Where it’s kept.
object
How much of it was counted on when the meal went on the list, keeping that much off the list.
object
What went on the list: for Undo, their ids go in /list/restore’s remove.
object
The list it’s on.
How much, as it shows: “1 ½ cups”, “half a bag”, or empty.
A unit id, like “cup” or “pound”; null for a count.
An amount in words (“half a bag”), when it isn’t a number.
Its aisle’s id.
How it got on the list: from the plan, typed in, every week, a usual buy, or the assistant.
The planned meals it’s for.
object
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.
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." } }}No such meal.
object
object
object
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}The meal isn’t cooked.
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.