Developer Resourceswishlist
Wishlist API Reference
Detailed wishlist API contracts, DTOs, request/response payloads, errors, and integration guidance.
Wishlist Module API & Integration Guide
1. How to Read / Quick Metadata
- Module:
Wishlist - Auth model:
JwtAuthGuard - Base URL:
/api/wishlist - Response envelope:
ResponseDto<T> - Swagger tag:
Wishlist (Mobile)
Route ownership note:
- APIs are mounted at
/api/wishlist/*. - There is currently no
/api/mobile/wishlist/*route composition.
2. High-Level API Overview
Wishlist API provides customer-authenticated operations to:
- save sellable products
- list saved products with optional pagination
- remove one or many saved products
The API is stateless per request and scoped by authenticated customer identity.
3. Core Concepts and Terminology
- Wishlist item: server-side saved product row.
- Saved state: product exists in wishlist for user.
- Bulk remove request: one API request removing up to 100 product IDs.
- Pagination metadata:
count,currentPage,totalPagereturned whenpagination=true.
4. Route Summary
| Method | Path | Auth |
|---|---|---|
POST | /api/wishlist/items | User JWT |
GET | /api/wishlist/items | User JWT |
DELETE | /api/wishlist/items | User JWT |
5. DTO Contracts
5.1 AddWishlistItemDto
{
"productId": 101
}| Field | Type | Required | Validation |
|---|---|---|---|
productId | integer | yes | @IsInt(), @Min(1) |
5.2 WishlistQueryDto
Query params:
| Field | Type | Required | Default | Validation |
|---|---|---|---|---|
page | integer | no | 1 | @IsInt(), @Min(1) |
size | integer | no | 20 | @IsInt(), @Min(1) |
pagination | boolean | no | true | boolean transform ("false" => false) |
5.3 DeleteWishlistItemsDto
{
"productIds": [101, 102, 103]
}| Field | Type | Required | Validation |
|---|---|---|---|
productIds | integer[] | yes | @ArrayMinSize(1), @ArrayMaxSize(100), each @IsInt(), each @Min(1) |
5.4 WishlistItemResponseDto
{
"id": 1,
"productId": 101,
"addedAt": "2026-04-23T10:30:00.000Z",
"productTitle": "Lenovo thinkpad t450s",
"productSlug": "lenovo-thinkpad-t450s",
"productThumbnail": "https://cdn.example.com/thumb.jpg",
"productType": "laptop",
"productKind": "physical",
"unitMrp": 20000000,
"unitSp": 195000,
"discount": 19805000,
"averageRating": 4.2,
"reviewCount": 12
}| Field | Type | Nullable | Description |
|---|---|---|---|
id | integer | no | Wishlist row ID |
productId | integer | no | Product ID |
addedAt | ISO timestamp | no | Added time |
productTitle | string | no | Product title from products.title |
productSlug | string | no | Product slug from products.slug |
productThumbnail | string | yes | Product thumbnail URL |
productType | string | yes | Product type name from productTypes.name |
productKind | enum | yes | Product kind (physical, digital, care_package) |
unitMrp | integer | no | MRP in paisa |
unitSp | integer | no | Selling price in paisa |
discount | integer | no | Derived: mrp - sp |
averageRating | float | yes | Average rating from approved reviews. Null if no reviews. |
reviewCount | integer | no | Count of approved reviews |
5.5 DeleteWishlistItemsResponseDto
{
"deletedCount": 2
}| Field | Type | Description |
|---|---|---|
deletedCount | integer | Number of removed wishlist rows |
6. Endpoint Reference
6.1 POST /api/wishlist/items
Purpose
Add a sellable product to the authenticated customer's wishlist.
Request
Headers:
Authorization: Bearer <jwt>Content-Type: application/json
Body:
{
"productId": 101
}Success Response
HTTP 200
{
"message": "Product added to wishlist",
"data": {
"id": 1,
"productId": 101,
"addedAt": "2026-04-23T10:30:00.000Z",
"productTitle": "Lenovo thinkpad t450s",
"productSlug": "lenovo-thinkpad-t450s",
"productThumbnail": "https://cdn.example.com/thumb.jpg",
"productType": "laptop",
"productKind": "physical",
"unitMrp": 20000000,
"unitSp": 195000,
"discount": 19805000,
"averageRating": 4.2,
"reviewCount": 12
}
}Error Responses
| HTTP | errorCode | Message | When |
|---|---|---|---|
| 404 | WISHLIST_PRODUCT_NOT_FOUND | Product not found or not available | Product missing or not sellable |
| 400 | WISHLIST_ALREADY_EXISTS | Product already in wishlist | Duplicate save attempt |
6.2 GET /api/wishlist/items
Purpose
Return customer wishlist items in newest-first order.
Request
Headers:
Authorization: Bearer <jwt>
Query:
page(optional)size(optional)pagination(optional)
Success Response (pagination enabled)
HTTP 200
{
"message": "Wishlist items fetched",
"data": [
{
"id": 2,
"productId": 102,
"addedAt": "2026-04-23T11:10:00.000Z",
"productTitle": "Dell XPS 15",
"productSlug": "dell-xps-15",
"productThumbnail": "https://cdn.example.com/dell-thumb.jpg",
"productType": "laptop",
"productKind": "physical",
"unitMrp": 150000,
"unitSp": 135000,
"discount": 15000,
"averageRating": 4.5,
"reviewCount": 24
},
{
"id": 1,
"productId": 101,
"addedAt": "2026-04-23T10:30:00.000Z",
"productTitle": "Lenovo thinkpad t450s",
"productSlug": "lenovo-thinkpad-t450s",
"productThumbnail": "https://cdn.example.com/lenovo-thumb.jpg",
"productType": "laptop",
"productKind": "physical",
"unitMrp": 20000000,
"unitSp": 195000,
"discount": 19805000,
"averageRating": 4.2,
"reviewCount": 12
}
],
"count": 2,
"currentPage": 1,
"totalPage": 1
}Success Response (pagination disabled)
HTTP 200
{
"message": "Wishlist items fetched",
"data": [
{
"id": 2,
"productId": 102,
"addedAt": "2026-04-23T11:10:00.000Z",
"productTitle": "Dell XPS 15",
"productSlug": "dell-xps-15",
"productThumbnail": "https://cdn.example.com/dell-thumb.jpg",
"productType": "laptop",
"productKind": "physical",
"unitMrp": 150000,
"unitSp": 135000,
"discount": 15000,
"averageRating": 4.5,
"reviewCount": 24
}
]
}6.3 DELETE /api/wishlist/items
Purpose
Remove one or multiple products from customer's wishlist.
Request
Headers:
Authorization: Bearer <jwt>Content-Type: application/json
Body:
{
"productIds": [101, 102]
}Success Response
HTTP 200
{
"message": "Products removed from wishlist",
"data": {
"deletedCount": 2
}
}Error Responses
| HTTP | errorCode | Message | When |
|---|---|---|---|
| 404 | WISHLIST_ITEM_NOT_FOUND | Products not found in wishlist | None of submitted product IDs matched user rows |
Behavior note:
- Partial match delete is allowed. If at least one product matches, endpoint succeeds and returns deleted count.
7. Error Code Reference
| Error Code | HTTP | Description |
|---|---|---|
WISHLIST_PRODUCT_NOT_FOUND | 404 | Add request product missing or not sellable |
WISHLIST_ALREADY_EXISTS | 400 | Product already saved in same customer wishlist |
WISHLIST_ITEM_NOT_FOUND | 404 | Delete request has zero matching wishlist rows |
8. Integration Recipes
8.1 Save product recipe
- Call
POST /api/wishlist/items. - If
200, set UI state to saved. - If
WISHLIST_ALREADY_EXISTS, keep UI as saved.
8.2 Render wishlist screen
- Initial call:
GET /api/wishlist/items?page=1&size=20. - For full non-paginated mode:
pagination=false. - Render rows in descending
addedAtorder.
8.3 Bulk remove recipe
- Collect selected product IDs.
- Call
DELETE /api/wishlist/items. - Remove deleted entries from local state based on result.
9. Integration Diagram
10. Payload Cheatsheet
| Endpoint | Request | Success |
|---|---|---|
POST /items | { productId } | { id, productId, addedAt, productTitle, productSlug, productThumbnail, productType, productKind, unitMrp, unitSp, discount, averageRating, reviewCount } |
GET /items | page,size,pagination | WishlistItemResponseDto[] (+ optional pagination metadata) |
DELETE /items | { productIds[] } | { deletedCount } |
11. See Also
- Feature Guide: Wishlist Module Feature List
- Backend Guide: Wishlist Backend Documentation