spree_wishlist

Wishlist extension for Spree Commerce.

Last updated on: May 25 at 11:40 AM

source code bug tracker
Opensource
101 101 206
owner:  spree-contrib

Spree Wishlist

Build Status Code Climate

The Spree Wishlist extension enables multiple wishlists per user, as well as managing those as public (sharable) and private. It also includes the ability to notify a friend via email of a recommended product.


Installation

Add the following to your Gemfile

gem 'spree_wishlist', github: 'spree-contrib/spree_wishlist', branch: 'master'

Run

bundle install
bundle exec rails g spree_wishlist:install

API endpoints

Please read Spree API v1 summary first.

Available endpoints:

Wishlists management

  • GET /api/v1/wishlists - returns a list of wishlists for signed in user
  • GET /api/v1/wishlists/:id - returns single wishlists with a list of Products (Variants)
  • POST /api/v1/wishlists - creates a new wishlist

payload:

 wishlist: {
"name": "fathers day"
}
  • PATCH /api/v1/wishlists/:id

payload:

 wishlist: {
"name": "new name"
}
  • DELETE /api/v1/wishlists/:id

Wishlists products management

  • POST /api/v1/wished_products - adds Product (Variant) to a Wishlist

payload:

 wished_product: {
"variant_id": 2,
"wishlist_id": 1
}
  • PATCH /api/v1/wished_products/:id

payload:

 wished_product: {
"variant_id": 3,
"wishlist_id": 2
}
  • DELETE /api/v1/wished_products/:id

Wishlists V2

Wishlists management

  • GET /api/v2/storefront/wishlists - returns a list of wishlists for signed in user

  • GET /api/v2/storefront/wishlists/:access_hash - returns single wishlists with a list of Products (Variants)

payload:

 { "include": "wished_products.variant" }
  • PATCH /api/v2/storefront/wishlists/:access_hash

payload:

 wishlist: {
"name": "Wishlist name",
"is_default": true,
"is_private": true,
}
  • POST /api/v2/storefront/wishlists - creates a new wishlist

payload:

 wishlist: {
"name": "Wishlist name",
"is_default": true,
"is_private": true,
}
  • DELETE /api/v2/storefront/wishlists/:access_hash

Wishlists products management

  • POST /api/v2/storefront/wishlists/:access_hash/wished_products - adds Product (Variant) to a Wishlist

payload:

 wished_product: {
"variant_id": 2,
"remark": "I want this",
"quantity": 3
}
  • PATCH /api/v2/storefront/wishlists/:access_hash/wished_products/:id

payload:

 wished_product: {
"variant_id": 2,
"remark": "I want this",
"quantity": 4
}
  • DELETE /api/v2/storefront/wishlists/:access_hash/wished_products/:id

Contributing

See corresponding guidelines


Copyright (c) 2009-2020 Spree Commerce Inc. and contributors, released under the New BSD License

compatible spree versions
tags spree versions
master < 5.0, >= 3.7.0
v1.3 >= 1.0.0
authors
John Dyer