The Commerce Connect abstract service layers

Last updated Tuesday, July 17, 2018 in Sitecore Experience Commerce for Developer
Keywords: Development

The Commerce Connect core framework contains a number of abstract service layers that carry essential e-commerce information between the webshop solution and the back-end commerce system.

This topic describes the following service layers:

For more information, see the Commerce Connect Developer's Guide.

Shopping Cart

The Shopping Cart service layer is used to manage shopping carts from creation and retrieval to updating, locking, and removing. When the API is called, Commerce Connect collects and maintains information about the shopping cart and its content in xDB. The Shopping Cart layer also contains engagement features such as personalization rules and the Storefront Abandoned Cart marketing automation plan.

Inventory

Prices and inventory information change frequently. Inventory data in particular must be delivered in real time and prices might depend on the customer. Dynamic information of this type is not part of core product catalog information and does not belong in Sitecore content – it belongs in a separate repository. For this reason, prices and inventory information are handled by service layers that are separate from the product data model.

The Inventory service layer provides a number of methods that enable the retrieval of stock locations and stock statuses on products. A separate product index is populated with the product-specific location and stock status.

Pricing

Because prices change frequently and can be customer, date and location specific, they are not part of the core product catalog data and can be handled by an external system that is different from the system that owns the product data. For this reason, Commerce Connect contains a separate Pricing service layer.

The Pricing service layer retrieves prices of products according to the following methods:

  • The GetProductPrices method retrieves various prices of different types for a single product, for example, list price, sale price, volume price, campaign price and customer price.
  • The GetProductBulkPrices method retrieves prices for a list of products to limit the number of calls to the external system and improve performance. Only one price type is used at a time with bulk prices.
  • The GetCartTotal method calculates the total and subtotal for a shopping cart.

The following diagram illustrates the GetCartTotal method.

CommerceConnect_PricingSL_GetCartTotal_method.png

The other methods are similar, but each method accepts a different set of input parameters. Other input parameters are, for example, Product ID, Price Type ID, and Quantity.

Customers and Users

A user account is used for authentication (login information) whereas a customer account contains information about who will receive and pay for orders. In B2C scenarios, the customer and user accounts generally represent the same person, whereas in B2B scenarios, the customer account is likely to represent an organization or company and the user is one person acting on the customer's behalf. Therefore, there may not be a one-to-one relationship between customers and users.

The Customers and Users service layer provides a number of methods that enable Create, Read, Update, and Delete (CRUD) actions on customers and users of the site. By default, all customers and users are stored in Sitecore but you can change this by overriding the appropriate pipelines.

Orders

The Orders service layer provides a number of methods for submitting and retrieving orders.

Gift Cards

The Gift Cards service layer lets you retrieve a gift card for a specific user in a specific store. It also lets a visitor pay for an order using a gift card as payment.

Loyalty Programs

The Loyalty Programs service layer enables the retrieval of loyalty program and card information and the enrollment of a user in a specific loyalty program. It also lets a visitor pay for an order using a loyalty card as payment.

Payments

The Payments service layer includes methods for the retrieval of payment options and methods. The service layer implements support for federated payments. Federated payments are payments handled by a third-party payment service. The vendor does not have access to the customer payment information, such as a credit card number. It is also possible to retrieve costs associated with a given payment option (for example, automatic versus manual versus monthly invoice) and method (for example, choice of credit card).

Shipping

The Shipping service layer provides methods that enable the retrieval of shipping options and methods for a specific store or a particular user cart. It is also possible to retrieve costs associated with a given shipping option (for example, by e-mail message, pick up in store, or deliver to address) and method (for example, choice of delivery service).

Wish Lists

The Wish Lists service layer provides methods for creating and retrieving wish lists as well as adding and removing items from a list.

Globalization

The Globalization service layer contains functionality related to internationalization, such as support for cultures, currencies, languages, and so on.

Catalog

The Catalog service layer contains functionality related to product catalogs, such as raising page events and retrieving and managing products and categories. Page events can be raised for catalog browsing actions, such as visiting a product details page or category page, or performing a sort or keyword search.

Product Synchronization

Note

Product synchronization is not available in version 9.0 of Commerce Connect. It will be reintroduced in an update to version 9.0.

There are different ways to access product data in a solution that uses Sitecore and Commerce Connect. If you choose to store product data in Sitecore, the Product Synchronization service layer manages synchronization of core product data between the external commerce system and Sitecore. If you use another method of storing and accessing product data, you do not need to use the Product Synchronization service layer.

It is possible to do a full synchronization of products or to synchronize per product. Typically, the products are owned by the external system and made available in Sitecore as a copy, but the synchronization can be two-way, so changes made in Sitecore will be pushed to the external commerce system too.

There is a single repository containing products for all shops hosted in the solution, and data is stored in Sitecore using buckets.

Send feedback about the documentation to docsite@sitecore.net.