Skip to content

Move Wishlist Item to Cart

About

The moveWishlistToCart mutation moves a product from the customer's wishlist directly into their shopping cart. Use this mutation to:

  • Implement "Move to Cart" buttons on the wishlist page
  • Convert saved-for-later items into active cart items
  • Streamline the purchase flow from wishlist to checkout

The item is removed from the wishlist after it is successfully added to the cart.

The mutation returns the updated cart, not the wishlist — so a client can re-render the cart from the response without a follow-up read.

Authentication

This mutation requires customer authentication:

  • Authenticated customers: Provide a valid customer authentication token in the Authorization header. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>

Arguments

ArgumentTypeDescription
wishlistItemIdInt!The numeric _id of the wishlist item to move (not the IRI).
quantityIntNumber of units to add to cart. Defaults to 1 if omitted.
clientMutationIdStringOptional client-side mutation identifier for tracking.

Possible Returns

The payload is the cart the item landed in. These are the fields worth selecting; the full cart shape is documented on Get Cart.

FieldTypeDescription
wishlistToCart.idID!IRI-style cart identifier.
wishlistToCart._idIntNumeric cart id.
wishlistToCart.messageStringResult message confirming the move.
wishlistToCart.successBooleanWhether the move succeeded.
wishlistToCart.itemsCountIntLine items in the cart after the move.
wishlistToCart.itemsCartItemCursorConnectionThe cart's items, including the one just moved.
wishlistToCart.grandTotalFloatRecalculated grand total.
wishlistToCart.formattedGrandTotalStringThe same total, currency-formatted.
wishlistToCart.cartTokenStringToken identifying the cart.

Released under the MIT License.