This is a beta release of documentation for Magento 2.4, published for previewing soon-to-be-released functionality. Content in this version is subject to change. Links to the v2.4 code base may not properly resolve until the code is officially released.

wishlist query

The wishlist query has been deprecated. Wish list information is now provided by the customer query.

Use the wishlist query to retrieve information about a customer’s wish list. Authorization tokens describes how to supply an authorization token for a specific customer.

Syntax

wishlist: WishlistOutput

Example usage

The following query returns the customer’s wish list:

Request:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  wishlist {
    items_count
    name
    sharing_code
    updated_at
    items {
      id
      qty
      description
      added_at
      product {
        sku
        name
      }
    }
  }
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "data": {
    "wishlist": {
      "items_count": 2,
      "name": "Wish List",
      "sharing_code": "KAXDj0HlM7Y2s58mllsVhSJvRj4fWIZj",
      "updated_at": "2019-02-13 22:47:45",
      "items": [
        {
          "id": 1,
          "qty": 1,
          "description": "My first priority",
          "added_at": "2019-02-20 14:38:02",
          "product": {
            "sku": "MJ09",
            "name": "Taurus Elements Shell"
          }
        },
        {
          "id": 2,
          "qty": 1,
          "description": null,
          "added_at": "2019-02-20 14:38:28",
          "product": {
            "sku": "MSH11",
            "name": "Arcadio Gym Short"
          }
        }
      ]
    }
  }
}

Output attributes

Attribute Data type Description
items WishlistItem An array of items in the customer’s wish list
items_count Int The number of items in the wish list
name String When multiple wish lists are enabled, the name the customer assigns to the wish list
sharing_code String An encrypted code that Magento uses to link to the wish list
updated_at String The time of the last modification to the wish list

Wish list item attributes

Attribute Data type Description
added_at String The time when the customer added the item to the wish list
description String The customer’s comment about this item
id Int The wish list item ID
product ProductInterface The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes
qty Float The quantity of this wish list item