Overview
The Shopping API allows you to create, read, update, delete, and reorder shopping list items. Each item includes a name and category for organization.Endpoints
Get All Shopping Items
Retrieves all shopping items for the authenticated user’s household, ordered by position.
Array of shopping item objects
Create or Reorder Shopping Items
Creates a new shopping item or reorders existing items.
200 OK
Update Shopping Item
Updates an existing shopping item’s details.
Delete Shopping Item
Deletes (marks as purchased) a shopping item and creates a notification.
When a shopping item is deleted, a notification is automatically created with:
- Type: “shopping”
- Title: “Item Removed”
- Body: “You completed: [item name]“
Get Shopping Items Count
Returns the total number of shopping items for the household.
The count endpoint returns
{"count": 0} if the user is unauthorized, rather than throwing an error. This is different from other count endpoints.Error Responses
401 Unauthorized
User is not authenticated (returns
{"count": 0} for count endpoint)400 Bad Request
Missing required fields
500 Internal Server Error
Unexpected server error
Source Code Reference
- Main routes:
~/workspace/source/src/app/api/shopping/route.ts:18 - Count endpoint:
~/workspace/source/src/app/api/shopping/count/route.ts:18 - Delete endpoint:
~/workspace/source/src/app/api/shopping/delete/route.ts:19 - Update endpoint:
~/workspace/source/src/app/api/shopping/update/route.ts:18