CommerceWishlist Class
Get, create, update, and delete wishlists. Add wishlists to carts. Get wishlist items, add items to wishlists, and delete wishlist items.
These methods are for CommerceWishlist. All methods are static.
-
addItemToWishlist(webstoreId, wishlistId, wishlistItemInput)
Add an item to a wishlist for the context user.
-
addItemToWishlist(webstoreId, effectiveAccountId, wishlistId, wishlistItemInput)
Add an item to a wishlist.
-
addWishlistToCart(webstoreId, wishlistId)
Add a wishlist to the active cart for the context user.
-
addWishlistToCart(webstoreId, wishlistId, effectiveAccountId)
Add a wishlist to the active cart.
-
addWishlistToCartWithCartId(webstoreId, wishlistId, cartId)
Add a wishlist to a cart.
-
addWishlistToCartWithCartId(webstoreId, wishlistId, cartId, effectiveAccountId)
Add a wishlist to a cart.
-
createWishlist(webstoreId, wishlistInput)
Create a wishlist for the context user.
-
createWishlist(webstoreId, effectiveAccountId, wishlistInput)
Create a wishlist.
-
deleteWishlist(webstoreId, wishlistId)
Delete a wishlist for the context user.
-
deleteWishlist(webstoreId, effectiveAccountId, wishlistId)
Delete a wishlist.
-
getWishlist(webstoreId, effectiveAccountId, wishlistId, productFields, sortItemsBy)
Get a wishlist with product fields sorted by items.
-
getWishlist(webstoreId, effectiveAccountId, wishlistId, productFields, pageSize, sortItemsBy)
Get a wishlist with product fields sorted by items with a specified number of items per page.
-
getWishlistItems(webstoreId, effectiveAccountId, wishlistId, productFields, pageParam, sortItemsBy)
Get a page of sorted wishlist items with product fields.
-
Get a page of specified size of sorted wishlist items with product fields.
-
getWishlistSummaries(webstoreId, effectiveAccountId, includeDisplayedList)
Get wishlist summaries.
-
Get wishlist summaries with product fields sorted by items.
-
Get wishlist summaries with product fields sorted by items with a specified number of items per page.
-
removeWishlistItem(webstoreId, effectiveAccountId, wishlistId, wishlistItemId)
Remove an item from a wishlist.
-
updateWishlist(webstoreId, wishlistId, wishlistUpdateInput)
Update the name of a wishlist for the context user.
-
updateWishlist(webstoreId, effectiveAccountId, wishlistId, wishlistUpdateInput)
Update the name of a wishlist.
Add an item to a wishlist for the context user.
49.0
No
public static ConnectApi.WishlistItem addItemToWishlist(String webstoreId, String wishlistId, ConnectApi.WishlistItemInput wishlistItemInput)
- webstoreId
Type: String
ID of the webstore.
- wishlistId
Type: String
ID of the wishlist.
- wishlistItemInput
Type:
ConnectApi.WishlistItemInputA
ConnectApi.WishlistItemInputbody with the item to add to the wishlist.
Type: ConnectApi.WishlistItem
This method respects buyer View Product entitlements and only users entitled to view product data can access it.
Add an item to a wishlist.
49.0
No
public static ConnectApi.WishlistItem addItemToWishlist(String webstoreId, String effectiveAccountId, String wishlistId, ConnectApi.WishlistItemInput wishlistItemInput)
- webstoreId
Type: String
ID of the webstore.
- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.- wishlistId
Type: String
ID of the wishlist.
- wishlistItemInput
Type:
ConnectApi.WishlistItemInputA
ConnectApi.WishlistItemInputbody with the item to add to the wishlist.
Type: ConnectApi.WishlistItem
This method respects buyer View Product entitlements and only users entitled to view product data can access it.
Add a wishlist to the active cart for the context user.
49.0
No
public static ConnectApi.WishlistToCartResult addWishlistToCart(String webstoreId, String wishlistId)
- webstoreId
Type: String
ID of the webstore.
- wishlistId
Type: String
ID of the wishlist.
Type: ConnectApi.WishlistToCartResult
This method respects buyer View Product entitlements and only users entitled to view product data can access it.
Add a wishlist to the active cart.
49.0
No
public static ConnectApi.WishlistToCartResult addWishlistToCart(String webstoreId, String wishlistId, String effectiveAccountId)
- webstoreId
Type: String
ID of the webstore.
- wishlistId
Type: String
ID of the wishlist.
- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.
Type: ConnectApi.WishlistToCartResult
This method respects buyer View Product entitlements and only users entitled to view product data can access it.
Add a wishlist to a cart.
49.0
No
public static ConnectApi.WishlistToCartResult addWishlistToCartWithCartId(String webstoreId, String wishlistId, String cartId)
- webstoreId
Type: String
ID of the webstore.
- wishlistId
Type: String
ID of the wishlist.
- cartId
Type: String
ID of the cart. If
null, wishlist items are added to the active cart.
Type: ConnectApi.WishlistToCartResult
This method respects buyer View Product entitlements and only users entitled to view product data can access it.
Add a wishlist to a cart.
49.0
No
public static ConnectApi.WishlistToCartResult addWishlistToCartWithCartId(String webstoreId, String wishlistId, String cartId, String effectiveAccountId)
- webstoreId
Type: String
ID of the webstore.
- wishlistId
Type: String
ID of the wishlist.
- cartId
Type: String
ID of the cart. If
null, wishlist items are added to the active cart.- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.
Type: ConnectApi.WishlistToCartResult
This method respects buyer View Product entitlements and only users entitled to view product data can access it.
Create a wishlist for the context user.
49.0
No
public static ConnectApi.Wishlist createWishlist(String webstoreId, ConnectApi.WishlistInput wishlistInput)
- webstoreId
Type: String
ID of the webstore.
- wishlistInput
Type:
ConnectApi.WishlistInputA
ConnectApi.WishlistInputbody that includes the wishlist name and items.
Type: ConnectApi.Wishlist
Create a wishlist.
49.0
No
public static ConnectApi.Wishlist createWishlist(String webstoreId, String effectiveAccountId, ConnectApi.WishlistInput wishlistInput)
- webstoreId
Type: String
ID of the webstore.
- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.- wishlistInput
Type:
ConnectApi.WishlistInputA
ConnectApi.WishlistInputbody that includes the wishlist name and items.
Type: ConnectApi.Wishlist
Delete a wishlist for the context user.
49.0
No
public static Void deleteWishlist(String webstoreId, String wishlistId)
- webstoreId
Type: String
ID of the webstore.
- wishlistId
Type: String
ID of the wishlist.
Type: Void
Delete a wishlist.
51.0
No
public static Void deleteWishlist(String webstoreId, String effectiveAccountId, String wishlistId)
- webstoreId
Type: String
ID of the webstore.
- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.- wishlistId
Type: String
ID of the wishlist.
Type: Void
Get a wishlist with product fields sorted by items.
51.0
No
public static ConnectApi.Wishlist getWishlist(String webstoreId, String effectiveAccountId, String wishlistId, String productFields, ConnectApi.WishlistItemSortOrder sortItemsBy)
webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the account for which the request is made.If null, defaults to the account ID for the context user.
wishlistId
Type: String
ID of the wishlist.
productFields
Type: String
Comma-separated list of custom product fields. Fields aren’t case-sensitive. For example, ProductCode and productcode return the same results.
sortItemsBy
Type: ConnectApi.WishlistItemSortOrder
Sort order for wishlist items. Values are:
CreatedDateAsc—Sorts by oldest creation date.CreatedDateDesc—Sorts by most recent creation date.
The default sort order is CreatedDateDesc.
Type: ConnectApi.Wishlist
Get a wishlist with product fields sorted by items with a specified number of items per page.
51.0
No
public static ConnectApi.Wishlist getWishlist(String webstoreId, String effectiveAccountId, String wishlistId, String productFields, Integer pageSize, ConnectApi.WishlistItemSortOrder sortItemsBy)
webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the account for which the request is made.If null, defaults to the account ID for the context user.
wishlistId
Type: String
ID of the wishlist.
productFields
Type: String
Comma-separated list of custom product fields. Fields aren’t case-sensitive. For example, ProductCode and productcode return the same results.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortItemsBy
Type: ConnectApi.WishlistItemSortOrder
Sort order for wishlist items. Values are:
CreatedDateAsc—Sorts by oldest creation date.CreatedDateDesc—Sorts by most recent creation date.
The default sort order is CreatedDateDesc.
Type: ConnectApi.Wishlist
Get a page of sorted wishlist items with product fields.
51.0
No
public static ConnectApi.WishlistItemCollection getWishlistItems(String webstoreId, String effectiveAccountId, String wishlistId, String productFields, String pageParam, ConnectApi.WishlistItemSortOrder sortItemsBy)
webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the account for which the request is made.If null, defaults to the account ID for the context user.
wishlistId
Type: String
ID of the wishlist.
productFields
Type: String
Comma-separated list of custom product fields. Fields aren’t case-sensitive. For example, ProductCode and productcode return the same results.
pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as currentPageToken or nextPageToken. If you pass in null, the first page is returned.
sortItemsBy
Type: ConnectApi.WishlistItemSortOrder
Sort order for wishlist items. Values are:
CreatedDateAsc—Sorts by oldest creation date.CreatedDateDesc—Sorts by most recent creation date.
The default sort order is CreatedDateDesc.
Type: ConnectApi.WishlistItemCollection
Get a page of specified size of sorted wishlist items with product fields.
51.0
No
public static ConnectApi.WishlistItemCollection getWishlistItems(String webstoreId, String effectiveAccountId, String wishlistId, String productFields, String pageParam, Integer pageSize, ConnectApi.WishlistItemSortOrder sortItemsBy)
webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the account for which the request is made. If null, defaults to the account ID for the context user.
wishlistId
Type: String
ID of the wishlist.
productFields
Type: String
Comma-separated list of custom product fields. Fields aren’t case-sensitive. For example, ProductCode and productcode return the same results.
pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 200. If you pass in null, the default size is 25.
sortItemsBy
Type: ConnectApi.WishlistItemSortOrder
Sort order for wishlist items. Values are:
CreatedDateAsc—Sorts by oldest creation date.CreatedDateDesc—Sorts by most recent creation date.
The default sort order is CreatedDateDesc.
Type: ConnectApi.WishlistItemCollection
Get wishlist summaries.
49.0
No
public static ConnectApi.WishlistsSummary getWishlistSummaries(String webstoreId, String effectiveAccountId, Boolean includeDisplayedList)
- webstoreId
Type: String
ID of the webstore.
- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.- includeDisplayedList
Type: Boolean
Specifies whether to include the displayed list (
true) or not (false). Ifnull, defaults tofalse.
Type: ConnectApi.WishlistsSummary
Get wishlist summaries with product fields sorted by items.
51.0
No
public static ConnectApi.WishlistsSummary getWishlistSummaries(String webstoreId, String effectiveAccountId, Boolean includeDisplayedList, String productFields, ConnectApi.WishlistItemSortOrder sortItemsBy)
webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the account for which the request is made.If null, defaults to the account ID for the context user.
includeDisplayedList
Type: Boolean
Specifies whether to include the displayed list (true) or not (false).
productFields
Type: String
Comma-separated list of custom product fields. Fields aren’t case-sensitive. For example, ProductCode and productcode return the same results.
If includeDisplayedList is false, productFields is ignored.
sortItemsBy
Type: ConnectApi.WishlistItemSortOrder
Sort order for wishlist items. Values are:
CreatedDateAsc—Sorts by oldest creation date.CreatedDateDesc—Sorts by most recent creation date.
The default sort order is CreatedDateDesc.
If includeDisplayedList is false, sortItemsBy is ignored.
Type: ConnectApi.WishlistsSummary
Get wishlist summaries with product fields sorted by items with a specified number of items per page.
51.0
No
public static ConnectApi.WishlistsSummary getWishlistSummaries(String webstoreId, String effectiveAccountId, Boolean includeDisplayedList, Integer pageSize, String productFields, pageSize, ConnectApi.WishlistItemSortOrder sortItemsBy)
webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the account for which the request is made.If null, defaults to the account ID for the context user.
includeDisplayedList
Type: Boolean
Specifies whether to include the displayed list (true) or not (false).
productFields
Type: String
Comma-separated list of custom product fields. Fields aren’t case-sensitive. For example, ProductCode and productcode return the same results.
If includeDisplayedList is false, productFields is ignored.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortItemsBy
Type: ConnectApi.WishlistItemSortOrder
Sort order for wishlist items. Values are:
CreatedDateAsc—Sorts by oldest creation date.CreatedDateDesc—Sorts by most recent creation date.
The default sort order is CreatedDateDesc.
If includeDisplayedList is false, sortItemsBy is ignored.
Type: ConnectApi.WishlistsSummary
Remove an item from a wishlist.
49.0
No
public static Void removeWishlistItem(String webstoreId, String effectiveAccountId, String wishlistId, String wishlistItemId)
- webstoreId
Type: String
ID of the webstore.
- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.- wishlistId
Type: String
ID of the wishlist.
- wishlistItemId
Type: String
ID of the wishlist item to remove.
Type: Void
Update the name of a wishlist for the context user.
50.0
No
public static ConnectApi.WishlistSummary updateWishlist(String webstoreId, String wishlistId, ConnectApi.WishlistUpdateInput wishlistUpdateInput)
- webstoreId
Type: String
ID of the webstore.
- wishlistId
Type: String
ID of the wishlist.
- wishlistUpdateInput
Type:
ConnectApi.WishlistUpdateInputA
ConnectApi.WishlistUpdateInputbody with the wishlist name to update.
Type: ConnectApi.WishlistSummary
Update the name of a wishlist.
50.0
No
public static ConnectApi.WishlistSummary updateWishlist(String webstoreId, String effectiveAccountId, String wishlistId, ConnectApi.WishlistUpdateInput wishlistUpdateInput)
- webstoreId
Type: String
ID of the webstore.
- effectiveAccountId
Type: String
ID of the account for which the request is made.If
null, defaults to the account ID for the context user.- wishlistId
Type: String
ID of the wishlist.
- wishlistUpdateInput
Type:
ConnectApi.WishlistUpdateInputA
ConnectApi.WishlistUpdateInputbody with the wishlist name to update.