Toggle Wishlist
Add or remove a product variant from the user's wishlist. If the item is already in the wishlist, it's removed; otherwise, it's added.
Endpoint
Authentication
Required (User role)
Request Body
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
product_variant_id |
integer | Yes | Product variant ID to toggle |
Response
Success (200 OK)
When Adding to Wishlist
When Removing from Wishlist
Error Responses
Product Not Found (404)
Validation Error (400)
Example Request
curl -X POST "https://api.luxmart.site/v1/products/wishlist/" \
-H "Authorization: Token your_access_token" \
-H "Content-Type: application/json" \
-d '{
"product_variant_id": 5
}'
Notes
- If the product variant is already in the wishlist, it's removed
- If the product variant is not in the wishlist, it's added
- Product variant must exist and not be deleted
- Each user can only have one wishlist entry per product variant