---
schema_version: "1"
id: f2c393baa60cb56838a963be31204238ab9fe411bf02873c81eb08ac61460461
title: Salesforce Commerce Wishlists API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/salesforce-commerce/guides/d2c-commerce/b2b-d2c-comm-wishlists-apis.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-d2c-comm-wishlists-apis.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 045260338b1f88e3401339895eac6b21108b241caab7e6e9f55de8fef90ae6a5
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
# Salesforce Commerce Wishlists API

The Salesforce Commerce Wishlists API allows customers to manage their Wishlists. Wishlists provide customers with a convenient way to save or bookmark products they are interested in. For example, while browsing for products, customers can add items to their Wishlists for future reference. Wishlists are available in both B2B stores.

There are six Wishlist-related APIs—some manage Wishlists, while others handle individual items. These APIs allow you to add products to new or existing Wishlist, delete Wishlist items, add Wishlist items to a cart, or move all items from a cart to a Wishlist. Although the Lightning Web Runtime (LWR) template doesn't support moving all Wishlist items to a specific cart in the UI, you can use the API to create a custom solution for this.

The [Commerce Webstore Wishlists API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlists.htm) can be used to retrieve a list of Wishlists or to create a new Wishlist for a user. The GET method retrieves the details of the user's Wishlists but does not include associated products by default. You can use the includeDisplayedList request parameter to fetch complete details of the oldest Wishlist, including associated items and their related data (such as fields and images). However, to fetch complete details about a particular WishList, pass the wishListId request parameter. The POST method allows you to create a new Wishlist by providing the Wishlist name and the IDs of the products you want to associate with it.

The [Commerce Webstore Wishlist API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist.htm) allows you to update, delete, or retrieve a specific Wishlist. The GET method fetches complete details of the specified Wishlist, including associated items and their related data. The PATCH method is limited to updating only the Wishlist's name, without support for modifying any other attributes. To delete a specific Wishlist, the DELETE method can be used.

For managing individual Wishlist items, the [Commerce Webstore Wishlist Item API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_item.htm) provides functionality to delete a single item. The DELETE method allows you to remove a specific item from a Wishlist.

The [Commerce Webstore Wishlist Items API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_items.htm) allows you to add items to a Wishlist or retrieve them. The GET method retrieves items from a specified Wishlist, while the POST method adds a single product to an existing Wishlist. Typically used on the Product Detail Page, this API enables users to bookmark a product by adding it to one of their existing Wishlists.

The [Commerce Webstore Wishlist, Add To Cart API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_add_to_cart.htm) allows you to move all products from a Wishlist to an active and specific cart. For example, if you're on the Wishlist page and want to add all items from a Wishlist to a cart, you can make a POST request to move the items to the desired cart. Currently, the Lightning Web Runtime (LWR) experience builder site does not support adding Wishlist items to a specific cart through the user interface. However, if customers are creating their own custom experience, they can use this API to build an action that adds all items from a Wishlist to an active cart.

The [Commerce Webstore Cart, Add To Wishlist API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_cart_add_to_wishlist.htm?q=%2Factions%2Fadd-cart-to-wishlist) enables users to move products from their active and specific cart to an existing Wishlist. This API functions exclusively within the cart, allowing users to move all items from the cart to a specified Wishlist using the POST method.

## Use Case

Let's consider a basic scenario for building a flow using Wishlists APIs. This example covers just a few Wishlists APIs and doesn't include the entire APIs functionality.

### Scenario 1

![Diagram of the wishlists API workflow for B2B and D2C Commerce](https://developer.salesforce.com/media/d2c-commerce/wishlists_apis_workflow.png '{"class": "image-lg", "title": "Checkout Workflow"}')

Imagine a scenario where a buyer is on the Product Detail page and wants to bookmark a product for future reference. In this case, they would make a POST request to the [Commerce Webstore Wishlist Items API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_items.htm) to add the product to an existing Wishlist. Later, if the buyer decides to remove a specific product from their Wishlist, they would send a DELETE request to the [Commerce Webstore Wishlist Item API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_item.htm) to remove that item.

### Scenario 2

![Continuation of the wishlists API workflow diagram for B2B and D2C Commerce](https://developer.salesforce.com/media/d2c-commerce/wishlists_apis_workflow1.png '{"class": "image-lg", "title": "Checkout Workflow"}')

Consider a scenario where a customer adds multiple items to their cart but decides to complete the purchase at a later time. For instance, on a shopping site, the customer can add products directly to your cart, and if you change your mind, you can move those products to your Wishlist for later reference. In this case, you can make a POST request to the [Commerce Webstore Cart, Add To Wishlist API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_cart_add_to_wishlist.htm?q=%2Factions%2Fadd-cart-to-wishlist) to transfer products from your active cart to an existing Wishlist.

## Resources

Here’s a list of Commerce Wishlists resources:

| Resource                                                                                                                                                                                                                                                             | Supported HTTP Methods | Description                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------ |
| [`/commerce/webstores/{webstoreId}/wishlists`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlists.htm)                                                                                       | GET, POST              | Create a new WishList or fetch collection of WishList. |
| [`/commerce/webstores/{webstoreId}/wishlists/{wishlistId}`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist.htm)                                                                           | DELETE, GET, PATCH     | Delete, edit, or fetch a specific WishList.            |
| [`/commerce/webstores/{webstoreId}/wishlists/{wishlistId}/actions/add-wishlist-to-cart`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_add_to_cart.htm)                                  | POST                   | Add all products from WishList to the provided Cart.   |
| [`/commerce/webstores/{webstoreId}/wishlists/{wishlistId}/wishlist-items`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_items.htm)                                                      | GET, POST              | Get wishlist items or add items to the wishlist.       |
| [`/commerce/webstores/{webstoreId}/wishlists/{wishlistId}/wishlist-items/{wishlistItemId}`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_wishlist_item.htm)                                      | DELETE                 | Delete single WishList item.                           |
| [`/commerce/webstores/{webstoreId}/carts/cartStateOrId/actions/add-cart-to-wishlist`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_cart_add_to_wishlist.htm?q=%2Factions%2Fadd-cart-to-wishlist) | POST                   | Copy products from Cart to WishList.                   |
