Skip to main content

setWishlist

Replaces the current user's or guest's wishlist. Works for an authenticated user or a guest (see Guest mode).

Description​

Replaces the whole wishlist of the authenticated user, or of a guest identified by the x-guest-id header (see Guest mode), with the items you pass. Resolves to the updated IWishlistResponse.

.setWishlist(

);

Parameters schema​

Schema

body(required): IWishlistSet
New wishlist contents.
example:

{ items: [{ productId: 1 }] }

body.items(required): IWishlistItem[]
New contents of the wishlist.
example:

[{ productId: 1 }]

items.productId(required): number
Product ID.
example: 1

items.addedAt: string
Date and time the item was added, in ISO 8601 format.
example: "2026-05-30T10:00:00.000Z"

Examples​

Minimal example​

const response = await Users.setWishlist({
items: [{ productId: 2957 }],
});

Example response​

{
"items": [
{
"productId": 2957,
"addedAt": "2026-10-27T09:17:09.914Z"
}
],
"total": 1
}

Response schema​

Schema: IWishlistResponse

items: IWishlistItem[]
Items in the wishlist.

items.productId: number
Product ID.
example: 1

items.addedAt: string
Date and time the item was added, in ISO 8601 format.
example: "2026-05-30T10:00:00.000Z"

total: number
Number of products in the wishlist.
example: 3