Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width70%
Shop module provides product management capabilities with an external database, inventory management and the shopping cart process with REST integration for a headless shopping experience. There Provides basic e-commerce features like product and inventory management, shopping cart process.., based on data hosted outside the Magnolia JCR repository. There is no payment integrated yet.

Table of Contents
maxLevel4

Column
width30%
JIRASHOP
GitGit

...

After all the above is ready products can be created, assigned to categories, with images, price, dimensions and all custom fields that the user had defined. Products can then be published and be available for the customers.

REST API

Once all of this is in place, the front end app can be created to query for products, add to shopping cart, checkout, create wish lists... by using the REST api.

API Path: /shop/v1

Method

Path

Description

Templating function
PRODUCT
GET/catalogs

Return all the catalogs

True
GET/catalog/{catalogId}

Return the requested catalog and :

  • The list of currencies
  • The category tree
  • The list of shipping methods
True
GET/catalog/{catalogId}/products

Return all the catalog products
Query string:
- limit: Limit the number of results
- offset: Index to return the results from
- sort: Field to use for sorting and the order (ie: sort=date:asc, sort=date:desc)

Does not return linked objects

True
GET/category/{categoryId}Return the requested category and its tree of categoriesTrue
GET/category/{categoryId}/products

Return all the category products
Query string:
- limit: Limit the number of results
- offset: Index to return the results from
- sort: Field to use for sorting and the order (ie: sort=date:asc, sort=date:desc)


Does not return linked objects

True
GET/shipping/methods/{methodId}Return the requested shipping method and its list of ratesTrue
GET/product/{productId}

Return the requested product and 

  • The list of prices
  • The list of custom fields
  • The list of categories
  • The tax rate
True
GET/product/{productId}/priceReturn the price of the product regarding the current date and the requested quantity (body of the request)True
CART
POST/cart

If the user is anonymous (unable to fetch the user from the underlying http session), then it creates an anonymous cart.

Otherwise, it create a cart linked to the user id.


Return a cookie storing the cart id

false
GET

/cart

Return the cart

The cart id is taken from the cookie

true
DELETE/cart

Delete the cart

The cart id is taken from the cookie

false
POST/cart/item

Update the cart by adding the cart item present in the body of the request

The cart id is taken from the cookie

false
PUT/cart/item

Update the cart by updating the cart item quantity (only field which can be updated)

The cart id is taken from the cookie

false
DELETE/cart/item/{itemId}

Update the cart by deleting the given cart item

The cart id is taken from the cookie

false
GET/cart/cross-sell

Return the cart cross-sell list of products

The cart id is taken from the cookie

true
WISHLIST
POST/wishlist

If the user is anonymous (unable to fetch the user from the underlying http session), then it creates an anonymous wish list.

Otherwise, it create a wish list linked to the user id.


Return a cookie storing the wish list id

false
GET

/wishlist

Return the wish list

The wish list id is taken from the cookie

true
DELETE/wishlist

Delete the wish list

The wish list id is taken from the cookie

false
POST/wishlist/item

Update the wish list by adding the wish list item present in the body of the request

The wish list id is taken from the cookie

false
DELETE/wishlist/item/{itemId}

Update the wish list by deleting the given wish list item

The wish list id is taken from the cookie

false
ORDER
POST/orderGet the current cart, the billing/shipping addresses, the shipping methods and convert them into an orderfalse
GET/orders

Get the list of orders whose the user id match with the session user id.

Does not work for the anonymous accesses.

true
GET/order/{orderId}

Get the requested order. 
Only return the order if the user id match with the session user id.
Does not work for the anonymous accesses.

true
PUT/order/{orderId}/cancel

Change the status of the order into CANCELLED if the user id match with the session user id.

Does not work for the anonymous accesses

false

Warnings

  • This module is at INCUBATOR level.

...