The grocery API handles two related features: generating shopping lists from a set of recipes (cross-referenced against the fridge), and managing a persistent per-user grocery checklist. When a grocery list is generated, each recipe’s state is automatically set toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/viet2811/ocipe/llms.txt
Use this file to discover all available pages before exploring further.
used and the plan is saved to history — giving you a full record of past meal planning cycles.
Generate a grocery list
POST /api/grocery/
The core grocery generation endpoint. Accepts a list of recipe IDs, aggregates all required ingredients, and cross-references them against the user’s fridge inventory to split results into items that need to be purchased versus items already on hand.
Authentication: Required — Authorization: Bearer <access_token>
Request body
A non-empty array of integer recipe IDs. Duplicate IDs are supported — if the same recipe appears more than once, its ingredient quantities are multiplied accordingly. Returns
400 Bad Request if the value is missing, not an array, or empty.Response
Ingredients needed for the selected recipes that are not in the user’s fridge. Each item has
name (string) and quantity (string). These are the items to purchase.Ingredients needed for the selected recipes that are already in the user’s fridge. Same shape as
grocery_list. Provided for reference so you know what you have available.Quantities are aggregated as text, joined with
+ (e.g. "200g + 150g"). If a recipe ID appears twice in recipe_ids, its quantity contribution is doubled in the aggregation — so "200g" becomes "200g + 200g". Numeric addition is not performed; the raw quantity strings are concatenated.recipe_ids to the user’s grocery plan history and sets the state of each referenced recipe to used.
Get grocery checklist
GET /api/grocery/list/
Returns all items in the authenticated user’s persistent grocery checklist. Items are returned newest-first (descending by ID). The checklist is independent of the grocery generation feature and persists between sessions.
Authentication: Required — Authorization: Bearer <access_token>
Response
Returns an array of grocery list item objects.Unique ID of the checklist item.
The item name or description.
Whether the item has been checked off. Defaults to
false.Add items to checklist
POST /api/grocery/list/
Adds one or more items to the persistent grocery checklist. Items are supplied as a newline-separated string, making it easy to paste a multi-item list in a single request.
Authentication: Required — Authorization: Bearer <access_token>
Request body
A newline-separated (
\n) string of item names. Blank lines are ignored. Returns 400 Bad Request if the string is empty or contains only whitespace.Response
- Single item: Returns
200 OKwith{"id": <new_id>}. - Multiple items: Returns
201 Createdwith an empty body.
Update a checklist item
PATCH /api/grocery/list/{id}/
Partially updates a single grocery checklist item. Typically used to toggle the isChecked state or rename an item.
Authentication: Required — Authorization: Bearer <access_token>
Path parameters
The ID of the checklist item to update.
Request body
Supply any subset of the following fields:Updated item name or description.
Updated checked state. Pass
true to mark as purchased, false to uncheck.Response
Returns the updated checklist item object.Delete a checklist item
DELETE /api/grocery/list/{id}/
Removes a single item from the grocery checklist.
Authentication: Required — Authorization: Bearer <access_token>
Path parameters
The ID of the checklist item to delete.
Response
Returns204 No Content on success with an empty body.
Clear the entire checklist
DELETE /api/grocery/list/
Deletes the authenticated user’s entire grocery checklist in one operation.
Authentication: Required — Authorization: Bearer <access_token>
Response
Returns204 No Content on success with an empty body.
Get grocery plan history
GET /api/grocery/history/
Returns all past grocery plans for the authenticated user, ordered newest-first. Each history entry records the recipe_ids that were submitted when the plan was generated and the timestamp of creation.
Authentication: Required — Authorization: Bearer <access_token>
Response
Returns an array of history objects.ISO 8601 timestamp of when the grocery plan was generated.
Array of recipe IDs that were included in that grocery run.
Get most recent grocery plan
GET /api/grocery/history/recent/
Returns only the single most recent grocery plan for the authenticated user. Useful for restoring the last planning session on app load.
Authentication: Required — Authorization: Bearer <access_token>
Response
Returns an array containing at most one history object (same shape as the full history endpoint). Returns an empty array if no history exists yet.Delete all history
DELETE /api/grocery/history/
Permanently deletes all grocery plan history for the authenticated user.
Authentication: Required — Authorization: Bearer <access_token>
Response
Returns204 No Content on success with an empty body.