data-src=../../../../includes/commerce-only.md

createWishlist mutation

The createWishlist mutation creates a wish list for the logged in customer. Adobe Commerce allows customers to have multiple wish lists.

This mutation requires a valid customer authentication token.

data-variant=info
data-slots=text
Use the storeConfig query with the following attributes to determine whether multiple wish lists are supported:

Syntax

mutation {
  createWishlist(input: CreateWishlistInput!) {
    CreateWishlistOutput
  }
}

Reference

The createWishlist reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following example creates the My favorites public wish list.

Request:

mutation {
  createWishlist(input: {
    name: "My favorites"
    visibility: PUBLIC
    }
  ) {
    wishlist {
      id
      name
      visibility
    }
  }
}

Response:

{
  "data": {
    "createWishlist": {
      "wishlist": {
        "id": "3",
        "name": "My favorites",
        "visibility": "PUBLIC"
      }
    }
  }
}