setWishlist
Replace the current user's or guest's wishlist. 🔐 This method requires authorization (or a guest context).
Description
This method replaces the entire wishlist of the current context - an authorized user or a guest (resolved via the x-guest-id header, see Guest mode) - with the supplied items. It returns a Promise that resolves to the updated IWishlistResponse object.
Users.setWishlist(
body*);
Parameters schema
Schema
body(required): IWishlistSet
New wishlist contents
example:
{ items: [{ productId: 1 }] }
body.items(required): IWishlistItem[]
New wishlist items.
example:
[{ productId: 1 }]
items.productId(required): number
Product identifier.
example: 1
items.addedAt: string
ISO date when the item was added.
example: "2026-05-30T10:00:00.000Z"
Examples
Minimal example
const response = await Users.setWishlist({
items: [{ productId: 1 }],
});
Example response
{
"items": [
{
"productId": 2957,
"addedAt": "2026-06-07T14:43:33.527Z"
}
],
"total": 1
}
Response schema
Schema: IWishlistResponse
items: IWishlistItem[]
Wishlist items.
items.productId: number
Product identifier.
example: 1
items.addedAt: string
ISO date when the item was added.
example: "2026-05-30T10:00:00.000Z"
total: number
Total number of items in the wishlist.
example: 3