Wishlist Management
Wishlist API Documentation
Base URL: {base_url}/api/v1/e-commerce/wishlist
Short Description: The Wishlist Management API provideslets comprehensiveauthenticated wishlistusers functionalitysave products for thelater, NextGateorganize e-commercethem platform.into Itnamed supportsgroups, addingtransfer productsitems tobetween wishlist, viewing saved items, removing products, clearing wishlist,groups, and movingmove items directly to cartthe withcart. real-timeEvery pricingwishlist operation is strictly private — users can only read and stockmodify information.their own wishlist.
Hints:
- All
wishlist operationsendpoints require a valid JWT Bearer token — there are no public wishlist endpoints - When adding a product, pass either
groupId(existing group) orgroupName(creates a new group) — passing both returns400 - Group names are unique per user
authentication—viaattemptingBearerto create a duplicate name returns400 - Deleting a group with
?deleteProducts=false(default) moves all items in that group to Ungrouped;?deleteProducts=truepermanently removes those items from the wishlist PATCH /{itemId}/groupwithgroupId: nullmoves an item to Ungrouped without deleting itisInWishlist,wishlistItemId,wishlistGroupId, andwishlistGroupNameare populated on the single product detail response (GET /api/v1/e-commerce/products/{slug}) for authenticated users
Standard Response Format
Success Response Structure
{
"success": true,
"httpStatus": "OK",
"message": "Operation completed successfully",
"action_time": "2025-09-23T10:30:45",
"data": {}
}
Error Response Structure
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "Error description",
"action_time": "2025-09-23T10:30:45",
"data": "Error description"
}
Standard Response Fields
| Field | Type | Description |
|---|---|---|
success |
boolean | true for successful operations, false for errors |
httpStatus |
string | HTTP status name (OK, BAD_REQUEST, NOT_FOUND, etc.) |
message |
string | Human-readable message describing the result |
action_time |
string | ISO 8601 timestamp of when the response was generated |
data |
object/string | Response payload on success, error details on failure |
Standard Error Types
400 BAD_REQUEST: Business rule violation (duplicate product, duplicate group name, ambiguous group fields)401 UNAUTHORIZED: Missing, expired, or invalid JWT tokenEach404:userNOT_FOUNDhas their own persistentProduct, wishlistthatitem,maintainsorstategroupacrossnotsessionsfoundPrevents422:duplicateUNPROCESSABLE_ENTITYproductsValidation-errorseachwithproductfield-levelcan only be added once per userdetailReal-time500:priceINTERNAL_SERVER_ERRORandUnexpectedstockserverinformation displayed for all wishlist itemsSupports moving items directly from wishlist to cart with specified quantityWishlist items show current product pricing (prices may change after adding)Only existing products can be added to wishlist (deleted products filtered out)Wishlist persistence survives user logout/login cyclesIntegration with cart service for seamless move-to-cart functionalityerror
Endpoints
1. Add Product to Wishlist
Purpose: Adds a product to the authenticated user's wishlistwishlist. forOptionally futureplaces purchaseit considerationin an existing group (via groupId) or creates a new group on the fly (via groupName). If neither is provided the item lands in Ungrouped.
Endpoint: POST {base_url}/api/v1/e-commerce/wishlist/add
Access Level: 🔒 Protected (Requires authentication)valid JWT)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token |
Request JSON Sample:
{
"productId": "456e7890-e89b-12d3-a456-426614174001"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"groupName": "Birthday Gifts"
}
Request Body Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
productId |
UUID | Yes | ID of the product to add | Must be a valid, non-deleted product |
groupId |
UUID | No | Add to |
groupName |
groupName |
string | No | Create a new group with this name and add product |
Must not already exist groupId |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Product added to wishlist successfully"in group 'Birthday Gifts'",
"action_time": "2026-06-04T14:22:10",
"data": null
}
BusinessSuccess LogicResponse Fields:
PreventsduplicateentriesField -Description eachmessageConfirms the product canwasonlyadded;beincludesaddedgrouponcenameperwhenuserapplicableOnlyallowsnon-deleted products to be addedNo quantity concept in wishlist (unlike cart)400 Bad Request: Invalid productId format401 Unauthorized: Authentication required or invalid token404 Not Found: Product not found or has been deleted422 Unprocessable Entity: Product already in wishlist
Error Responses:
- JSON
Error ExampleSample:
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "'iPhoneSony 15 Pro'WH-1000XM5' is already in your wishlist",
"action_time": "2026-06-04T14:22:10",
"data": null"'Sony WH-1000XM5' is already in your wishlist"
}
2. Get Wishlist (Flat)
Purpose: RetrievesReturns the completeauthenticated user's full wishlist withas alla savedflat items,list. pricing,Each item includes its group ID and availabilitygroup informationname (or null if Ungrouped). Useful for list views where grouping is handled client-side.
Endpoint: GET {base_url}/api/v1/e-commerce/wishlist
Access Level: 🔒 Protected (Requires authentication)valid JWT)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Wishlist retrieved successfully",
"action_time": "2026-06-04T14:22:10",
"data": {
"user": {
"userId": "111e2222-e89b-12d3-a456-426614174003"uuid",
"userName": "john.doe"josh_dev",
"name": "JohnJosh Doe"Sakweli"
},
"wishlistSummary": {
"totalItems": 4,3,
"totalValue": 3596.00,749.97,
"inStockItems": 3,2,
"outOfStockItems": 1
},
"wishlistItems": [
{
"wishlistId": "wish001-e89b-12d3-a456-426614174004"uuid",
"productId": "456e7890-e89b-12d3-a456-426614174001"uuid",
"productName": "iPhoneSony 15 Pro Max 512GB"WH-1000XM5",
"productSlug": "iphone-15-pro-max-512gb"sony-wh-1000xm5",
"productImage": "https://cdn.example.com/images/iphone15-pro-max.img.jpg",
"unitPrice": 1199.00,
"discountAmount": 100.00,349.99,
"isOnSale": true,false,
"shop": {
"shopId": "123e4567-e89b-12d3-a456-426614174000"uuid",
"shopName": "TechStoreTech Pro"Haven",
"shopSlug": "techstore-pro"tech-haven",
"logoUrl": "https://cdn.example.com/logos/techstore-pro.png"logo.jpg"
},
"availability": {
"inStock": true,
"stockQuantity": 2512
},
"groupId": "uuid",
"groupName": "Birthday Gifts",
"addedAt": "2025-09-23T10:30:00Z"
},
{
"wishlistId": "wish002-e89b-12d3-a456-426614174005",
"productId": "567e8901-e89b-12d3-a456-426614174002",
"productName": "MacBook Air M3",
"productSlug": "macbook-air-m3",
"productImage": "https://example.com/images/macbook-air-m3.jpg",
"unitPrice": 999.00,
"discountAmount": 0.00,
"isOnSale": false,
"shop": {
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"logoUrl": "https://example.com/logos/techstore-pro.png"
},
"availability": {
"inStock": true,
"stockQuantity": 8
},
"addedAt": "2025-09-22T14:15:00Z"
},
{
"wishlistId": "wish003-e89b-12d3-a456-426614174006",
"productId": "678e9012-e89b-12d3-a456-426614174003",
"productName": "Samsung Galaxy Watch 6",
"productSlug": "samsung-galaxy-watch-6",
"productImage": "https://example.com/images/galaxy-watch-6.jpg",
"unitPrice": 299.00,
"discountAmount": 50.00,
"isOnSale": true,
"shop": {
"shopId": "234e5678-e89b-12d3-a456-426614174001",
"shopName": "Gadget World",
"shopSlug": "gadget-world",
"logoUrl": "https://example.com/logos/gadget-world.png"
},
"availability": {
"inStock": false,
"stockQuantity": 0
},
"addedAt": "2025-09-21T09:45:00Z"2026-06-04T10:00:00"
}
],
"updatedAt": "2025-09-23T10:30:00Z"2026-06-04T10:00:00"
}
}
Success Response StructureFields:
User Summary
| Field | Description |
|---|---|
user.userId |
|
user.userName |
|
user.name |
Wishlist Summary
wishlistSummary.totalItems |
Total number of |
wishlistSummary.totalValue |
|
wishlistSummary.inStockItems |
|
wishlistSummary.outOfStockItems |
Wishlist Item Details
wishlistItems[].wishlistId |
|
wishlistItems[].productId |
|
wishlistItems[].productName |
|
wishlistItems[].productSlug |
URL-friendly product identifier |
wishlistItems[].productImage |
|
wishlistItems[].unitPrice |
Current price of the product |
wishlistItems[].isOnSale |
Whether the product is currently on sale |
wishlistItems[].shop |
Shop |
wishlistItems[].availability.inStock |
|
wishlistItems[].availability.stockQuantity |
|
wishlistItems[].groupId |
UUID of the group this item belongs to (null if Ungrouped) |
wishlistItems[].groupName |
Name of the group (null if Ungrouped) |
wishlistItems[].addedAt |
Timestamp when the product was added |
updatedAt |
Timestamp of the most recently added item |
Real-time Information:
Prices reflect current product pricing (may differ from when added)Stock quantities show real-time availabilitySale status and discounts updated automatically
Error Responses:
3. Remove fromGet Wishlist (Grouped)
Purpose: RemovesReturns the wishlist organized into sections — one section per named group plus a specificseparate itemUngrouped fromsection. theUseful user'sfor wishlistgrouped display views.
Endpoint: DELETEGET {base_url}/api/v1/e-commerce/wishlist/{itemId}grouped
Access Level: 🔒 Protected (Requires authentication)valid JWT)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token |
PathSuccess Parameters:
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Product removed fromGrouped wishlist retrieved successfully",
"action_time": "2026-06-04T14:22:10",
"data": null{
"user": {
"userId": "uuid",
"userName": "josh_dev",
"name": "Josh Sakweli"
},
"wishlistSummary": {
"totalItems": 3,
"totalValue": 749.97,
"inStockItems": 2,
"outOfStockItems": 1
},
"groups": [
{
"groupId": "uuid",
"groupName": "Birthday Gifts",
"itemCount": 2,
"items": [ ]
}
],
"ungrouped": {
"groupId": null,
"groupName": "Ungrouped",
"itemCount": 1,
"items": [ ]
},
"updatedAt": "2026-06-04T10:00:00"
}
}
BusinessSuccess LogicResponse Fields:
OnlyallowsremovingField user'sDescription ownuserSame user summary as flat response wishlistSummarySame summary totals across all items groupsArray of named group sections, ordered by creation date (oldest first) groups[].groupIdUUID of the group groups[].groupNameName of the group groups[].itemCountNumber of items in this group groups[].itemsArray of wishlist item responses (same shape as flat list items) ungroupedSection for items with no group assigned ungrouped.groupIdAlways nullungrouped.groupNameAlways "Ungrouped"ungrouped.itemCountCount of items with no group ungrouped.itemsArray of ungrouped wishlist items WishlistupdatedAtTimestamp of the most recently added item ispermanentlydeleted from databaseNo undo functionality available
4. ClearRemove Item from Wishlist
Purpose: RemovesPermanently allremoves itemsa specific item from the authenticated user's wishlistwishlist.
Endpoint: DELETE {base_url}/api/v1/e-commerce/wishlist/clear{itemId}
Access Level: 🔒 Protected (Requires authentication)valid JWT — owns the item)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token |
Path Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
itemId |
UUID | Yes | The wishlistId of the item to remove |
Must belong to the authenticated user |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "WishlistProduct clearedremoved from wishlist successfully",
"action_time": "2026-06-04T14:22:10",
"data": null
}
Business Logic:
Removes all wishlist items for the authenticated userPermanent deletion - cannot be undoneWishlist becomes empty after operation
Use Cases:
User wants to start fresh with empty wishlistBulk cleanup of saved itemsAdministrative wishlist reset
Error Responses:
5. MoveClear to CartWishlist
Purpose: MovesPermanently aremoves wishlistall itemitems directly tofrom the shoppingauthenticated cartuser's withwishlist. specifiedGroups quantityare not deleted — only the items inside them.
Endpoint: POSTDELETE {base_url}/api/v1/e-commerce/wishlist/move-to-cart/{itemId}clear
Access Level: 🔒 Protected (Requires authentication)valid JWT)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token> |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Wishlist cleared successfully",
"action_time": "2026-06-04T14:22:10",
"data": null
}
6. Move Item to Cart
Purpose: Adds a wishlist item to the user's cart at the specified quantity. The item remains in the wishlist — it is not automatically removed.
Endpoint: POST {base_url}/api/v1/e-commerce/wishlist/move-to-cart/{itemId}
Access Level: 🔒 Protected (Requires valid JWT)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token> |
Path Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
itemId |
UUID | Yes | wishlistId of the |
Query Parameters:
| Parameter | Type | Required | Description | Validation | Default |
|---|---|---|---|---|---|
quantity |
integer | No | Quantity to add to cart | Min: |
1 |
RequestSuccess URL Examples:
POST /api/v1/wishlist/move-to-cart/wish001-e89b-12d3-a456-426614174004
POST /api/v1/wishlist/move-to-cart/wish001-e89b-12d3-a456-426614174004?quantity=2
Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Product moved to cart successfully",
"action_time": "2026-06-04T14:22:10",
"data": null
}
7. Transfer Item to Group
Purpose: Moves a wishlist item to a different group, or removes it from its current group by setting groupId to null (moves to Ungrouped). The item stays in the wishlist — only its group assignment changes.
Endpoint: PATCH {base_url}/api/v1/e-commerce/wishlist/{itemId}/group
Access Level: 🔒 Protected (Requires valid JWT — owns the item)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token> |
Path Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
itemId |
UUID | Yes | The wishlistId of the item to transfer |
Must belong to the authenticated user |
Request JSON Sample — move to a group:
{
"groupId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Request JSON Sample — remove from group (move to Ungrouped):
{
"groupId": null
}
BusinessRequest LogicBody Parameters:
AddsParameter Type Required Description Validation groupIdUUID or null Yes Target group UUID, or nullto move to UngroupedWhen a UUID, must be a group that belongs to the productauthenticatedtousercartusingCart Service integrationUses specified quantity (default: 1)Validates stock availability before adding to cartKeeps item in wishlist after moving to cart (doesn't remove)If product already in cart, increases quantity
StockSuccess ValidationResponse JSON Sample:
{
Validates"success": requestedtrue,
quantity"httpStatus": doesn't"OK",
exceed"message": available"Item stock moved Leveragesto cartgroup service'Electronics'",
stock"action_time": validation"2026-06-04T14:22:10",
logic "data": Providesnull
detailed}
error
8. Create Group
Purpose: Creates a new named wishlist group for stockthe issuesauthenticated user. Group names must be unique per user.
Endpoint: POST {base_url}/api/v1/e-commerce/wishlist/groups
Access Level: 🔒 Protected (Requires valid JWT)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token> |
Request JSON Sample:
{
"name": "Electronics"
}
Request Body Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
name |
string | Yes | Display name for the group | Must not be blank. Must be unique for the authenticated user |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Wishlist group created successfully",
"action_time": "2026-06-04T14:22:10",
"data": {
"groupId": "uuid",
"name": "Electronics",
"itemCount": 0,
"createdAt": "2026-06-04T14:22:10"
}
}
Success Response Fields:
| Field | Description |
|---|---|
groupId |
UUID of the newly created group |
name |
Name of the group as saved |
itemCount |
Always 0 on creation |
createdAt |
Timestamp of group creation |
Error Responses:
Error ExamplesSample:
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "InsufficientA stockgroup fornamed 'iPhoneElectronics' 15already Pro'exists",
"action_time": "2026-06-04T14:22:10",
"data": "A group named 'Electronics' already exists"
}
9. Get Groups
Purpose: Returns all wishlist groups created by the authenticated user, ordered by creation date (oldest first). OnlyEach 1group unitsincludes available"a live item count.
Endpoint: GET {base_url}/api/v1/e-commerce/wishlist/groups
Access Level: 🔒 Protected (Requires valid JWT)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token> |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Wishlist groups retrieved successfully",
"action_time": "2026-06-04T14:22:10",
"data": [
{
"groupId": "uuid",
"name": "Birthday Gifts",
"itemCount": 3,
"createdAt": "2026-06-01T09:00:00"
},
{
"groupId": "uuid",
"name": "Electronics",
"itemCount": 1,
"createdAt": "2026-06-03T11:30:00"
}
]
}
Success Response Fields:
| Field | Description |
|---|---|
[].groupId |
UUID of the group |
[].name |
Display name of the group |
[].itemCount |
Current number of wishlist items in this group |
[].createdAt |
Timestamp of group creation |
10. Delete Group
Purpose: Deletes a wishlist group. Controls what happens to the items inside via the deleteProducts query parameter.
Endpoint: DELETE {base_url}/api/v1/e-commerce/wishlist/groups/{groupId}
Access Level: 🔒 Protected (Requires valid JWT — owns the group)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <token> |
Path Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
groupId |
UUID | Yes | UUID of the group to delete | Must belong to the authenticated user |
Query Parameters:
| Parameter | Type | Required | Description | Validation | Default |
|---|---|---|---|---|---|
deleteProducts |
boolean | No | true → permanently delete all items in the group from wishlist. false → move items to Ungrouped, then delete group |
true or false |
false |
Success Response JSON Sample — items moved to Ungrouped:
{
"success": true,
"httpStatus": "OK",
"message": "Group deleted, products moved to Ungrouped",
"action_time": "2026-06-04T14:22:10",
"data": null
}
Success Response JSON Sample — items permanently deleted:
{
"success": true,
"httpStatus": "OK",
"message": "Group and all its products deleted from wishlist",
"action_time": "2026-06-04T14:22:10",
"data": null
}
Quick Reference Guide
Common HTTP Status Codes
200 OK: Successful GET/POST/DELETE request400 Bad Request: Invalid request data or validation errors401 Unauthorized: Authentication required or invalid token404 Not Found: Wishlist item, product, or user not found422 Unprocessable Entity: Duplicate product or stock validation errors500 Internal Server Error: Server error during processing
Authentication Requirements
Bearer Token: IncludeAuthorization: Bearer your_tokenin headers- All
endpointsEndpointsrequire authentication- no public wishlist operations User-specific wishlists- each user has their own isolated wishlist
Data Format Standards
Dates: ISO 8601 format (2025-09-23T14:30:00Z)Prices: Decimal with 2 decimal places (999.00)UUIDs: Standard UUID format (123e4567-e89b-12d3-a456-426614174000)
Business Rules
Wishlist Management
One Product Per User: Each product can only be added once per userNo Quantity Concept: Wishlist doesn't store quantities (unlike cart)Real-time Pricing: Prices shown are current, not when addedStock Awareness: Shows current availability statusPersistent Storage: Survives logout/login cyclesNo Expiration: Items remain until manually removed
Integration with Cart
Move to Cart: Seamless integration with cart serviceStock Validation: Validates availability when moving to cartQuantity Support: Can specify quantity when moving to cartPreserves Wishlist: Item remains in wishlist after moving to cart
Wishlist vs Cart ComparisonSummary
| Description | |||
|---|---|---|---|
/wishlist/add |
Add product to |
||
/wishlist |
Get flat wishlist | ||
/wishlist/grouped |
Get |
||
/wishlist/{itemId} |
Remove |
||
/wishlist/clear |
Clear entire wishlist | ||
/wishlist/move-to-cart/{itemId} |
Move item to cart | ||
| PATCH | /wishlist/{itemId}/group |
Transfer item to |
|
| 8 | POST | /wishlist/groups |
Create group |
| 9 | GET | /wishlist/groups |
Get all groups |
| 10 | DELETE | /wishlist/groups/{groupId} |
Delete group |
CommonGroup UseBehavior CasesRules
SaveforLater:Scenario POSTBehavior /api/v1/wishlist/addAdd with productIdnoViewgroupSavedItem Items:landsGETin/api/v1/wishlistUngroupedforcompletewishlistAdd RemovewithgroupIdItem :DELETE /api/v1/wishlist/{itemId}Clear All: DELETE /api/v1/wishlist/clear groupMoveadded toPurchase:thatPOSTexisting/api/v1/wishlist/move-to-cart/{itemId}?quantity=2ErrorHandling PatternsDuplicate Product: Clear message indicating product already savedStock Issues: Real-time stock validationAdd with detailed messagesAuthentication: Standard authentication error responsesNot Found: Generic messages for securitygroupName(don'tnew)revealNew group created, item existence)added to it
Add with groupName(exists)400— duplicate group nameAdd with both groupIdandgroupName400— ambiguous requestDelete group ?deleteProducts=falseItems move to Ungrouped, group deleted Delete group ?deleteProducts=trueItems permanently removed, group deleted Transfer item with groupId: nullItem moved to Ungrouped