Merran documentation API & integrations
Put things at home back as they were
const url = 'http://localhost:3000/api/pantry/restore';const options = { method: 'POST', headers: { cookie: 'merran.session_token=<merran.session_token>', 'Content-Type': 'application/json' }, body: '{"items":[{"id":"0199e8b0-5a10-7a01-8b00-000000000026","name":"chicken thighs","foodKey":"chicken thigh","quantity":2,"unit":"pound","amountText":null,"aisle":"0199e8b0-5a10-7a01-8b00-000000000021","storedIn":"fridge","useBy":"2026-10-18","forMeals":[{"meal":"0199e8b0-5a10-7a01-8b00-00000000001b","quantity":2,"unit":"pound","counted":{"quantity":2,"unit":"pound"}}],"createdAt":"2026-10-15T18:30:00.000Z"}]}'};
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/restore \ --header 'Content-Type: application/json' \ --cookie merran.session_token=<merran.session_token> \ --data '{ "items": [ { "id": "0199e8b0-5a10-7a01-8b00-000000000026", "name": "chicken thighs", "foodKey": "chicken thigh", "quantity": 2, "unit": "pound", "amountText": null, "aisle": "0199e8b0-5a10-7a01-8b00-000000000021", "storedIn": "fridge", "useBy": "2026-10-18", "forMeals": [ { "meal": "0199e8b0-5a10-7a01-8b00-00000000001b", "quantity": 2, "unit": "pound", "counted": { "quantity": 2, "unit": "pound" } } ], "createdAt": "2026-10-15T18:30:00.000Z" } ] }'Undo: things as using them up or changing them said they were. One used up comes back with its id. An aisle that’s gone is left empty. With an API key, it needs the pantry: write permission.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Something at home as it was, to put it back (Undo).
object
Where it’s kept.
Example
2026-10-20object
How much of it was counted on when the meal went on the list, keeping that much off the list.
object
Example
{ "id": "0199e8b0-5a10-7a01-8b00-000000000026", "name": "chicken thighs", "foodKey": "chicken thigh", "quantity": 2, "unit": "pound", "amountText": null, "aisle": "0199e8b0-5a10-7a01-8b00-000000000021", "storedIn": "fridge", "useBy": "2026-10-18", "forMeals": [ { "meal": "0199e8b0-5a10-7a01-8b00-00000000001b", "quantity": 2, "unit": "pound", "counted": { "quantity": 2, "unit": "pound" } } ], "createdAt": "2026-10-15T18:30:00.000Z"}Example
{ "items": [ { "id": "0199e8b0-5a10-7a01-8b00-000000000026", "name": "chicken thighs", "foodKey": "chicken thigh", "quantity": 2, "unit": "pound", "amountText": null, "aisle": "0199e8b0-5a10-7a01-8b00-000000000021", "storedIn": "fridge", "useBy": "2026-10-18", "forMeals": [ { "meal": "0199e8b0-5a10-7a01-8b00-00000000001b", "quantity": 2, "unit": "pound", "counted": { "quantity": 2, "unit": "pound" } } ], "createdAt": "2026-10-15T18:30:00.000Z" } ]}Responses
Section titled “Responses”Back as they were.
object
object
How much, as it shows: “2 lb”, “half a bag”, or empty for just “have it”.
Where it’s kept.
The planned meals it’s set aside for.
object
The meal’s on the shopping list and still to come: using this up leaves it short.
How much is set aside for it: “2 lb”, or empty.
How much of that isn’t there any more, for a meal on the list: what to put back on it.
Example
{ "items": [ { "id": "0199e8b0-5a10-7a01-8b00-000000000026", "name": "chicken thighs", "amount": "2 lb", "quantity": 2, "unit": "pound", "amountText": null, "storedIn": "fridge", "aisle": "0199e8b0-5a10-7a01-8b00-000000000021", "useBy": "2026-10-18", "meals": [ { "id": "0199e8b0-5a10-7a01-8b00-00000000001b", "name": "Lemon Chicken", "date": "2026-10-17", "status": "planned", "onList": true, "amount": "2 lb", "short": null } ], "useSoon": { "kind": "soon", "date": "2026-10-18" }, "createdAt": "2026-10-15T18:30:00.000Z" } ]}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." } }}© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.