# Wishlists

In this section, we will see all the APIs which are related to Customer Product Wishlists.

# Get Wishlists

You can get all the Wishlists from the Bagisto store. You can achieve this job by using the Wishlists API call.

  • Headers

    Key Value
    Accept application/json
  • Single Request Endpoint

    POST http(s)://example.com/graphql

TIP

If you are using pagination and want to know more info about responses then check the explanation portion.

Note You can pass all the input fields to filter the Wishlist data.

  • Query
      query wishlists {
          wishlists(input: {
              page: 1
              limit: 10
              # id: 3
              # productId: 16
              # productName: "Music Show"
              # channelId: 1
          }) {
              id
              channelId
              productId
              customerId
              itemOptions
              additional
              movedToCart
              shared
              timeOfMoving
              createdAt
              updatedAt
              customer {
                  id
                  firstName
                  lastName
                  name
                  gender
                  dateOfBirth
                  email
                  phone
                  password
                  apiToken
                  customerGroupId
                  subscribedToNewsLetter
                  isVerified
                  token
                  notes
                  status
                  createdAt
                  updatedAt
              }
              product {
                  id
                  type
                  attributeFamilyId
                  sku
                  parentId
                  createdAt
                  updatedAt
              }
              channel {
                  id
                  code
                  name
                  description
                  theme
                  homePageContent
                  footerContent
                  hostname
                  defaultLocaleId
                  baseCurrencyId
                  rootCategoryId
                  homeSeo
                  defaultLocale
                  baseCurrency
                  rootCategory
                  logoUrl
                  faviconUrl
                  success
              }
          }
      }
    
Response
{
  "data": {
        "wishlists": [
            {
                "id": "1",
                "channelId": "1",
                "productId": "1",
                "customerId": "5",
                "itemOptions": null,
                "additional": "null",
                "movedToCart": null,
                "shared": null,
                "timeOfMoving": null,
                "createdAt": "2021-05-28 15:59:00",
                "updatedAt": "2021-05-28 15:59:00",
                "customer": {
                    "id": "5",
                    "firstName": "Naresh",
                    "lastName": "Verma",
                    "name": "Naresh Verma",
                    "gender": null,
                    "dateOfBirth": null,
                    "email": "naresh.verma327@webkul.com",
                    "phone": null,
                    "password": "$2y$10$tIP1ciRlUCI0ahjsYsjHsenTvXen1PBQKfRu0OklpufOAjf/ruC2O",
                    "apiToken": "r1bxG3wNl2No0mbTEEJnD6hWkADKcsMA8jnHDnA0zteEw2RRhaqAuUxehzqx7pARAS6WA9jLG3sanFhg",
                    "customerGroupId": 2,
                    "subscribedToNewsLetter": false,
                    "isVerified": true,
                    "token": "d5308d5f06d01d3393501cb6ebf4ae06",
                    "notes": null,
                    "status": true,
                    "createdAt": "2021-05-28 12:54:56",
                    "updatedAt": "2021-05-28 12:54:56"
                },
                "product": {
                    "id": "1",
                    "type": "simple",
                    "attributeFamilyId": 1,
                    "sku": "test-product",
                    "parentId": null,
                    "createdAt": "2021-05-26 17:43:12",
                    "updatedAt": "2021-05-26 17:43:12"
                },
                "channel": {
                    "id": "1",
                    "code": "default",
                    "name": "Default",
                    "description": null,
                    "theme": "velocity",
                    "homePageContent": "\n                    <p>@include(\"shop::home.slider\") @include(\"shop::home.featured-products\") @include(\"shop::home.new-products\")</p>\n                        <div class=\"banner-container\">\n                        <div class=\"left-banner\">\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/1.webp data-src=http://localhost/graphql/public/themes/default/assets/images/1.webp class=\"lazyload\" alt=\"test\" width=\"720\" height=\"720\" />\n                        </div>\n                        <div class=\"right-banner\">\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/2.webp data-src=http://localhost/graphql/public/themes/default/assets/images/2.webp class=\"lazyload\" alt=\"test\" width=\"460\" height=\"330\" />\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/3.webp data-src=http://localhost/graphql/public/themes/default/assets/images/3.webp  class=\"lazyload\" alt=\"test\" width=\"460\" height=\"330\" />\n                        </div>\n                    </div>\n                ",
                    "footerContent": "\n                    <div class=\"list-container\">\n                        <span class=\"list-heading\">Quick Links</span>\n                        <ul class=\"list-group\">\n                            <li><a href=\"@php echo route('shop.cms.page', 'about-us') @endphp\">About Us</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'return-policy') @endphp\">Return Policy</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'refund-policy') @endphp\">Refund Policy</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'terms-conditions') @endphp\">Terms and conditions</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'terms-of-use') @endphp\">Terms of Use</a></li><li><a href=\"@php echo route('shop.cms.page', 'contact-us') @endphp\">Contact Us</a></li>\n                        </ul>\n                    </div>\n                    <div class=\"list-container\">\n                        <span class=\"list-heading\">Connect With Us</span>\n                            <ul class=\"list-group\">\n                                <li><a href=\"#\"><span class=\"icon icon-facebook\"></span>Facebook </a></li>\n                                <li><a href=\"#\"><span class=\"icon icon-twitter\"></span> Twitter </a></li>\n                                <li><a href=\"#\"><span class=\"icon icon-instagram\"></span> Instagram </a></li>\n                                <li><a href=\"#\"> <span class=\"icon icon-google-plus\"></span>Google+ </a></li>\n                                <li><a href=\"#\"> <span class=\"icon icon-linkedin\"></span>LinkedIn </a></li>\n                            </ul>\n                        </div>\n                ",
                    "hostname": "http://localhost/graphql/public",
                    "defaultLocaleId": 1,
                    "baseCurrencyId": 1,
                    "rootCategoryId": 1,
                    "homeSeo": "{\"meta_title\": \"Demo store\", \"meta_keywords\": \"Demo store meta keyword\", \"meta_description\": \"Demo store meta description\"}",
                    "defaultLocale": "{\"id\":1,\"code\":\"en\",\"name\":\"English\",\"created_at\":null,\"updated_at\":null,\"direction\":\"ltr\",\"locale_image\":null}",
                    "baseCurrency": "{\"id\":1,\"code\":\"USD\",\"name\":\"US Dollar\",\"created_at\":null,\"updated_at\":null,\"symbol\":\"$\"}",
                    "rootCategory": "{\"id\":1,\"position\":1,\"image\":null,\"status\":1,\"_lft\":1,\"_rgt\":16,\"parent_id\":null,\"created_at\":\"2021-05-05T10:06:44.000000Z\",\"updated_at\":\"2021-05-05T10:06:44.000000Z\",\"display_mode\":\"products_and_description\",\"category_icon_path\":null,\"additional\":null,\"name\":\"Root\",\"description\":\"Root\",\"slug\":\"root\",\"url_path\":\"\",\"meta_title\":\"\",\"meta_description\":\"\",\"meta_keywords\":\"\",\"translations\":[{\"id\":1,\"name\":\"Root\",\"slug\":\"root\",\"description\":\"Root\",\"meta_title\":\"\",\"meta_description\":\"\",\"meta_keywords\":\"\",\"category_id\":1,\"locale\":\"en\",\"locale_id\":null,\"url_path\":\"\"}]}",
                    "logoUrl": null,
                    "faviconUrl": null,
                    "success": null
                }
            }
        ]
    }
}

# Get Wishlist By ID

To get the specific Wishlist, you have to pass an id field with query request .By using this resource and request payload, you will get only a single object under the data object in response.

  • Headers

    Key Value
    Accept application/json
    Authorization Bearer token-string

# Examples

Let's take an example,

  • Request Query
      query wishlist {
          wishlist(id: 1) {
              id
              channelId
              productId
              customerId
              itemOptions
              additional
              movedToCart
              shared
              timeOfMoving
              createdAt
              updatedAt
              customer {
                  id
                  firstName
                  lastName
                  name
                  gender
                  dateOfBirth
                  email
                  phone
                  password
                  apiToken
                  customerGroupId
                  subscribedToNewsLetter
                  isVerified
                  token
                  notes
                  status
                  createdAt
                  updatedAt
              }
              product {
                  id
                  type
                  attributeFamilyId
                  sku
                  parentId
                  createdAt
                  updatedAt
              }
              channel {
                  id
                  code
                  name
                  description
                  theme
                  homePageContent
                  footerContent
                  hostname
                  defaultLocaleId
                  baseCurrencyId
                  rootCategoryId
                  homeSeo
                  defaultLocale
                  baseCurrency
                  rootCategory
                  logoUrl
                  faviconUrl
                  success
              }
          }
      } 
    
Response
{
  "data": {
      "wishlist": {
          "id": "1",
          "channelId": "1",
          "productId": "1",
          "customerId": "5",
          "itemOptions": null,
          "additional": "null",
          "movedToCart": null,
          "shared": null,
          "timeOfMoving": null,
          "createdAt": "2021-05-28 15:59:00",
          "updatedAt": "2021-05-28 15:59:00",
          "customer": {
              "id": "5",
              "firstName": "Naresh",
              "lastName": "Verma",
              "name": "Naresh Verma",
              "gender": null,
              "dateOfBirth": null,
              "email": "naresh.verma327@webkul.com",
              "phone": null,
              "password": "$2y$10$tIP1ciRlUCI0ahjsYsjHsenTvXen1PBQKfRu0OklpufOAjf/ruC2O",
              "apiToken": "r1bxG3wNl2No0mbTEEJnD6hWkADKcsMA8jnHDnA0zteEw2RRhaqAuUxehzqx7pARAS6WA9jLG3sanFhg",
              "customerGroupId": 2,
              "subscribedToNewsLetter": false,
              "isVerified": true,
              "token": "d5308d5f06d01d3393501cb6ebf4ae06",
              "notes": null,
              "status": true,
              "createdAt": "2021-05-28 12:54:56",
              "updatedAt": "2021-05-28 12:54:56"
          },
          "product": {
              "id": "1",
              "type": "simple",
              "attributeFamilyId": 1,
              "sku": "test-product",
              "parentId": null,
              "createdAt": "2021-05-26 17:43:12",
              "updatedAt": "2021-05-26 17:43:12"
          },
          "channel": {
              "id": "1",
              "code": "default",
              "name": "Default",
              "description": null,
              "theme": "velocity",
              "homePageContent": "\n                    <p>@include(\"shop::home.slider\") @include(\"shop::home.featured-products\") @include(\"shop::home.new-products\")</p>\n                        <div class=\"banner-container\">\n                        <div class=\"left-banner\">\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/1.webp data-src=http://localhost/graphql/public/themes/default/assets/images/1.webp class=\"lazyload\" alt=\"test\" width=\"720\" height=\"720\" />\n                        </div>\n                        <div class=\"right-banner\">\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/2.webp data-src=http://localhost/graphql/public/themes/default/assets/images/2.webp class=\"lazyload\" alt=\"test\" width=\"460\" height=\"330\" />\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/3.webp data-src=http://localhost/graphql/public/themes/default/assets/images/3.webp  class=\"lazyload\" alt=\"test\" width=\"460\" height=\"330\" />\n                        </div>\n                    </div>\n                ",
              "footerContent": "\n                    <div class=\"list-container\">\n                        <span class=\"list-heading\">Quick Links</span>\n                        <ul class=\"list-group\">\n                            <li><a href=\"@php echo route('shop.cms.page', 'about-us') @endphp\">About Us</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'return-policy') @endphp\">Return Policy</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'refund-policy') @endphp\">Refund Policy</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'terms-conditions') @endphp\">Terms and conditions</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'terms-of-use') @endphp\">Terms of Use</a></li><li><a href=\"@php echo route('shop.cms.page', 'contact-us') @endphp\">Contact Us</a></li>\n                        </ul>\n                    </div>\n                    <div class=\"list-container\">\n                        <span class=\"list-heading\">Connect With Us</span>\n                            <ul class=\"list-group\">\n                                <li><a href=\"#\"><span class=\"icon icon-facebook\"></span>Facebook </a></li>\n                                <li><a href=\"#\"><span class=\"icon icon-twitter\"></span> Twitter </a></li>\n                                <li><a href=\"#\"><span class=\"icon icon-instagram\"></span> Instagram </a></li>\n                                <li><a href=\"#\"> <span class=\"icon icon-google-plus\"></span>Google+ </a></li>\n                                <li><a href=\"#\"> <span class=\"icon icon-linkedin\"></span>LinkedIn </a></li>\n                            </ul>\n                        </div>\n                ",
              "hostname": "http://localhost/graphql/public",
              "defaultLocaleId": 1,
              "baseCurrencyId": 1,
              "rootCategoryId": 1,
              "homeSeo": "{\"meta_title\": \"Demo store\", \"meta_keywords\": \"Demo store meta keyword\", \"meta_description\": \"Demo store meta description\"}",
              "defaultLocale": "{\"id\":1,\"code\":\"en\",\"name\":\"English\",\"created_at\":null,\"updated_at\":null,\"direction\":\"ltr\",\"locale_image\":null}",
              "baseCurrency": "{\"id\":1,\"code\":\"USD\",\"name\":\"US Dollar\",\"created_at\":null,\"updated_at\":null,\"symbol\":\"$\"}",
              "rootCategory": "{\"id\":1,\"position\":1,\"image\":null,\"status\":1,\"_lft\":1,\"_rgt\":16,\"parent_id\":null,\"created_at\":\"2021-05-05T10:06:44.000000Z\",\"updated_at\":\"2021-05-05T10:06:44.000000Z\",\"display_mode\":\"products_and_description\",\"category_icon_path\":null,\"additional\":null,\"name\":\"Root\",\"description\":\"Root\",\"slug\":\"root\",\"url_path\":\"\",\"meta_title\":\"\",\"meta_description\":\"\",\"meta_keywords\":\"\",\"translations\":[{\"id\":1,\"name\":\"Root\",\"slug\":\"root\",\"description\":\"Root\",\"meta_title\":\"\",\"meta_description\":\"\",\"meta_keywords\":\"\",\"category_id\":1,\"locale\":\"en\",\"locale_id\":null,\"url_path\":\"\"}]}",
              "logoUrl": null,
              "faviconUrl": null,
              "success": null
          }
      }
  }
}

# Add To Wishlist

You can Add a product to wishlist. You can achieve this job by using the Wishlist API call.

  • Headers

    Key Value
    Accept application/json
  • Single Request Endpoint

    POST http(s)://example.com/graphql

TIP

If you are using pagination and want to know more info about responses then check the explanation portion.

  • Query
      mutation addToWishlist {
          addToWishlist(input: {
              productId: 1
          }) {
              success
              wishlist {
                  id
                  channelId
                  productId
                  customerId
                  itemOptions
                  additional
                  movedToCart
                  shared
                  timeOfMoving
                  createdAt
                  updatedAt
                  customer {
                      id
                      firstName
                      lastName
                      name
                      gender
                      dateOfBirth
                      email
                      phone
                      password
                      apiToken
                      customerGroupId
                      subscribedToNewsLetter
                      isVerified
                      token
                      notes
                      status
                      createdAt
                      updatedAt
                  }
                  product {
                      id
                      type
                      attributeFamilyId
                      sku
                      parentId
                      createdAt
                      updatedAt
                  }
                  channel {
                      id
                      code
                      name
                      description
                      theme
                      homePageContent
                      footerContent
                      hostname
                      defaultLocaleId
                      baseCurrencyId
                      rootCategoryId
                      homeSeo
                      defaultLocale
                      baseCurrency
                      rootCategory
                      logoUrl
                      faviconUrl
                      success
                  }
              }
          }
      }
    
Response
{
  "data": {
        "addToWishlist": {
            "success": "Item Successfully Added To Wishlist",
            "wishlist": {
                "id": "1",
                "channelId": "1",
                "productId": "1",
                "customerId": "5",
                "itemOptions": null,
                "additional": "null",
                "movedToCart": null,
                "shared": null,
                "timeOfMoving": null,
                "createdAt": "2021-05-28 15:59:00",
                "updatedAt": "2021-05-28 15:59:00",
                "customer": {
                    "id": "5",
                    "firstName": "Naresh",
                    "lastName": "Verma",
                    "name": "Naresh Verma",
                    "gender": null,
                    "dateOfBirth": null,
                    "email": "naresh.verma327@webkul.com",
                    "phone": null,
                    "password": "$2y$10$tIP1ciRlUCI0ahjsYsjHsenTvXen1PBQKfRu0OklpufOAjf/ruC2O",
                    "apiToken": "r1bxG3wNl2No0mbTEEJnD6hWkADKcsMA8jnHDnA0zteEw2RRhaqAuUxehzqx7pARAS6WA9jLG3sanFhg",
                    "customerGroupId": 2,
                    "subscribedToNewsLetter": false,
                    "isVerified": true,
                    "token": "d5308d5f06d01d3393501cb6ebf4ae06",
                    "notes": null,
                    "status": true,
                    "createdAt": "2021-05-28 12:54:56",
                    "updatedAt": "2021-05-28 12:54:56"
                },
                "product": {
                    "id": "1",
                    "type": "simple",
                    "attributeFamilyId": 1,
                    "sku": "test-product",
                    "parentId": null,
                    "createdAt": "2021-05-26 17:43:12",
                    "updatedAt": "2021-05-26 17:43:12"
                },
                "channel": {
                    "id": "1",
                    "code": "default",
                    "name": "Default",
                    "description": null,
                    "theme": "velocity",
                    "homePageContent": "\n                    <p>@include(\"shop::home.slider\") @include(\"shop::home.featured-products\") @include(\"shop::home.new-products\")</p>\n                        <div class=\"banner-container\">\n                        <div class=\"left-banner\">\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/1.webp data-src=http://localhost/graphql/public/themes/default/assets/images/1.webp class=\"lazyload\" alt=\"test\" width=\"720\" height=\"720\" />\n                        </div>\n                        <div class=\"right-banner\">\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/2.webp data-src=http://localhost/graphql/public/themes/default/assets/images/2.webp class=\"lazyload\" alt=\"test\" width=\"460\" height=\"330\" />\n                            <img src=http://localhost/graphql/public/themes/default/assets/images/3.webp data-src=http://localhost/graphql/public/themes/default/assets/images/3.webp  class=\"lazyload\" alt=\"test\" width=\"460\" height=\"330\" />\n                        </div>\n                    </div>\n                ",
                    "footerContent": "\n                    <div class=\"list-container\">\n                        <span class=\"list-heading\">Quick Links</span>\n                        <ul class=\"list-group\">\n                            <li><a href=\"@php echo route('shop.cms.page', 'about-us') @endphp\">About Us</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'return-policy') @endphp\">Return Policy</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'refund-policy') @endphp\">Refund Policy</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'terms-conditions') @endphp\">Terms and conditions</a></li>\n                            <li><a href=\"@php echo route('shop.cms.page', 'terms-of-use') @endphp\">Terms of Use</a></li><li><a href=\"@php echo route('shop.cms.page', 'contact-us') @endphp\">Contact Us</a></li>\n                        </ul>\n                    </div>\n                    <div class=\"list-container\">\n                        <span class=\"list-heading\">Connect With Us</span>\n                            <ul class=\"list-group\">\n                                <li><a href=\"#\"><span class=\"icon icon-facebook\"></span>Facebook </a></li>\n                                <li><a href=\"#\"><span class=\"icon icon-twitter\"></span> Twitter </a></li>\n                                <li><a href=\"#\"><span class=\"icon icon-instagram\"></span> Instagram </a></li>\n                                <li><a href=\"#\"> <span class=\"icon icon-google-plus\"></span>Google+ </a></li>\n                                <li><a href=\"#\"> <span class=\"icon icon-linkedin\"></span>LinkedIn </a></li>\n                            </ul>\n                        </div>\n                ",
                    "hostname": "http://localhost/graphql/public",
                    "defaultLocaleId": 1,
                    "baseCurrencyId": 1,
                    "rootCategoryId": 1,
                    "homeSeo": "{\"meta_title\": \"Demo store\", \"meta_keywords\": \"Demo store meta keyword\", \"meta_description\": \"Demo store meta description\"}",
                    "defaultLocale": "{\"id\":1,\"code\":\"en\",\"name\":\"English\",\"created_at\":null,\"updated_at\":null,\"direction\":\"ltr\",\"locale_image\":null}",
                    "baseCurrency": "{\"id\":1,\"code\":\"USD\",\"name\":\"US Dollar\",\"created_at\":null,\"updated_at\":null,\"symbol\":\"$\"}",
                    "rootCategory": "{\"id\":1,\"position\":1,\"image\":null,\"status\":1,\"_lft\":1,\"_rgt\":16,\"parent_id\":null,\"created_at\":\"2021-05-05T10:06:44.000000Z\",\"updated_at\":\"2021-05-05T10:06:44.000000Z\",\"display_mode\":\"products_and_description\",\"category_icon_path\":null,\"additional\":null,\"name\":\"Root\",\"description\":\"Root\",\"slug\":\"root\",\"url_path\":\"\",\"meta_title\":\"\",\"meta_description\":\"\",\"meta_keywords\":\"\",\"translations\":[{\"id\":1,\"name\":\"Root\",\"slug\":\"root\",\"description\":\"Root\",\"meta_title\":\"\",\"meta_description\":\"\",\"meta_keywords\":\"\",\"category_id\":1,\"locale\":\"en\",\"locale_id\":null,\"url_path\":\"\"}]}",
                    "logoUrl": null,
                    "faviconUrl": null,
                    "success": null
                }
            }
        }
    }
}

# Remove From Wishlist

To remove a product from the wishlist, you have to pass an id field with query request .By using this resource and request payload, you will get only a single object under the data object in response.

  • Headers

    Key Value
    Accept application/json
    Authorization Bearer token-string

# Examples

Let's take an example,

  • Request Query
      mutation removeFromWishlist {
          removeFromWishlist(input: {
              productId: 1
          }) {
              status
              success
          }
      }
    
Response
{
   "data": {
      "removeFromWishlist": {
          "status": true,
          "success": "Item Successfully Removed From Wishlist"
      }
  }
}

:

# Remove All From Wishlist

To remove all product from the wishlist, you have to pass related fields with query request .

  • Headers

    Key Value
    Accept application/json
    Authorization Bearer token-string

# Examples

Let's take an example,

  • Request Query
      mutation removeAllWishlists {
          removeAllWishlists {
              status
              success
          }
      }
    
Response
{
   "data": {
      "removeAllWishlists": {
          "status": true,
          "success": "All The Items From Your Wishlist Have Been Removed"
      }
  }
}

:

# Move To Cart From Wishlist

You can move a product from wishlist to cart from the Bagisto store. You can achieve this job by using the Move To Cart From Wishlist API call.

  • Headers

    Key Value
    Accept application/json
  • Single Request Endpoint

    POST http(s)://example.com/graphql

TIP

If you are using pagination and want to know more info about responses then check the explanation portion.

  • Query
      mutation moveToCart {
          moveToCart(id: 2) {
              status
              success
          }
      }
    
Response
{
    "data": {
        "moveToCart": {
            "status": true,
            "success": "Item successfully moved To cart"
        }
    }
}