Sitecore Connect Developer Guide A4
Sitecore Connect Developer Guide A4
2
The Commerce Connect Developer's Guide Rev: 30 July 2014
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Sitecore Commerce Connect 7.2
Table of Contents
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 2 of 142
The Commerce Connect Developer's Guide
GetProductPrices ....................................................................................................................... 53
GetProductBulkPrices ................................................................................................................ 54
GetCartTotal ............................................................................................................................... 54
2.2.3 Pricing Pipelines ................................................................................................................ 55
GetProductPrices ....................................................................................................................... 55
GetProductBreakPrices .............................................................................................................. 56
GetCartTotals ............................................................................................................................. 56
2.3 Order ..................................................................................................................................... 58
2.3.1 The Order Domain Model .................................................................................................. 58
Class: Order ............................................................................................................................... 58
Class: OrderHeader ................................................................................................................... 58
2.3.2 Order Service Methods ..................................................................................................... 59
SubmitVisitorOrder ..................................................................................................................... 59
GetVisitorOrder .......................................................................................................................... 60
GetVisitorOrders ........................................................................................................................ 60
VisitorCancelOrder ..................................................................................................................... 61
2.3.3 Order Pipelines.................................................................................................................. 61
SubmitVisitorOrder ..................................................................................................................... 61
GetVisitorOrders ........................................................................................................................ 62
GetVisitorOrder .......................................................................................................................... 63
VisitorCancelOrder ..................................................................................................................... 63
2.4 Inventory................................................................................................................................ 65
2.4.1 The Inventory Domain Model ............................................................................................ 65
Class: StockInformation ............................................................................................................. 66
Class: OrderableInformation ...................................................................................................... 66
Class: IndexStockInformation .................................................................................................... 66
Class: StockInformationUpdate.................................................................................................. 67
Class: StockInformationUpdateLocation .................................................................................... 67
Class: StockDetailsLevel ............................................................................................................ 67
Class: StockStatus ..................................................................................................................... 68
Class: InventoryProduct ............................................................................................................. 69
Class: StockLocations ................................................................................................................ 69
2.4.2 Inventory Service Methods ................................................................................................ 69
GetStockInformation .................................................................................................................. 69
GetPreOrderableInformation ...................................................................................................... 70
GetBackOrderableInformation ................................................................................................... 71
VisitedProductStockStatus ......................................................................................................... 71
ProductsAreBackInStock ........................................................................................................... 72
VisitorSignUpForStockNotification ............................................................................................. 73
RemoveVisitorFromStockNotification ........................................................................................ 73
GetBackInStockInformation ....................................................................................................... 74
2.4.3 Inventory Pipelines ............................................................................................................ 75
GetStockInformation .................................................................................................................. 75
StockStatusForIndexing ............................................................................................................. 75
GetPreOrderableInformation ...................................................................................................... 77
GetBackOrderableInformation ................................................................................................... 77
VisitorAppliedFacet .................................................................................................................... 78
VisitorAppliedSortOrder ............................................................................................................. 78
ProductsAreBackInStock ........................................................................................................... 79
GetBackInStockInformation ....................................................................................................... 79
VisitorSignUpForStockNotification ............................................................................................. 80
RemoveVisitorFromStockNotification ........................................................................................ 81
OrderedProductStockStatus ...................................................................................................... 82
AddToCartStockStatus ............................................................................................................... 83
VisitedProductStockStatus ......................................................................................................... 83
CurrentProductID ....................................................................................................................... 84
2.5 Customer ............................................................................................................................... 85
2.5.1 The Customer Domain Model ........................................................................................... 85
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 3 of 142
Sitecore Commerce Connect 7.2
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 4 of 142
The Commerce Connect Developer's Guide
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 5 of 142
Sitecore Commerce Connect 7.2
Chapter 1
Introduction
Note
In the following, Connect is used as an abbreviation for Sitecore Commerce Connect and
ECS is used for External Commerce System.
For a general introduction and overview of the components in Connect, see the
Sitecore Commerce Connect Overview.
This guide describes the API and configuration of Connect for frontend developers
who create Sitecore solutions and are looking for information about how to use
Connect
If you are a developer looking for information about how to integrate Connect with an
external commerce systems, see the Connect Integration Guide
Chapter 1 — Introduction
This chapter contains an introduction for this guide.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 6 of 142
The Commerce Connect Developer's Guide
Chapter 2
This chapter describes the Connect API which consists of a number of abstract
service layers. Each section in this chapter describes a service layer, its relevant
classes and how to use it.
Carts
Pricing
Order
Inventory
Customer
Product Sync
Connect Configuration
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 7 of 142
Sitecore Commerce Connect 7.2
2.1 Carts
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 8 of 142
The Commerce Connect Developer's Guide
Note: The domain model consists of classes that make up the contracts with the external system. The
contracts are defined as classes instead of interfaces to allow the model to be easily extended later if
needed. This follow the best practice guidelines defined in the book Framework Design Guidelines.
Default implementation of the contracts are delivered as part of Connect. If an actual Connect
provider with an external commerce system contains more functionality than provided by default, the
implementation can be replaced. All instantiation of actual classes will be handled using the Factory
design pattern.
Cart Keys
A cart has two unique composite keys:
CartId (aka. ExternalCartId), ShopName
Some methods like LoadCart use this key to locate a cart.
UserId, CustomerId, CartName, ShopName
Some methods like GetCarts and CreateCart uses this key
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 9 of 142
Sitecore Commerce Connect 7.2
Class: Cart
The Cart is responsible for representing the collection of products a customer is planning to buy. It is
used when the content of the cart needs to be displayed or when Sitecore needs to determine the
content of the cart for any other purpose (such as personalization).
The Cart class inherits its base cart data from Cart Base. For more information, see class Cart Base
Above.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 10 of 142
The Commerce Connect Developer's Guide
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 11 of 142
Sitecore Commerce Connect 7.2
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 12 of 142
The Commerce Connect Developer's Guide
GetCarts
GetCarts is used to query Cart data against the external commerce system and doesn’t return a
collection of Carts, but a collection of CartBase objects that only contains the summary of the main
cart data.
Name: GetCarts
Description: Gets the carts that match the specified criteria. Calls the pipeline "GetCarts"
Usage: Called when a list of carts is needed.
Examples include:
Getting the carts for a specific visitor across all visitors
Getting one of the carts for the current visitor in a multi-cart solution
Getting the carts that have not been used within a period of time, e.g.
abandoned
Signature: GetCartsResult GetCarts(GetCartsRequest request)
Input:
UserId – Optional - The ids of the users whose carts should be retrieved. If no
value is specified, the user IDs are not considered when retrieving carts.
CustomerId – Optional – The ids of the customers whose carts should be
retrieved. If no value is specified the customer IDs are not considered when
retrieving carts.
CartName – Optional - The names of the carts that should be retrieved. If no
value is specified, the cart names are not considered when retrieving carts.
CartStatus – Optional – The status of carts that should be retrieved. Examples
include "Active" and "Abandoned". If no value is specified, the cart statuses are
not considered when retrieving carts.
This could be used in a B2B scenario when you want to display a list of
available carts to a user but only carts that are not locked.
IsLocked – Optional – If provided it will mean the search also will filter on
whether the cart is locked or not
ShopName – Optional. Name of shop to search for carts in
Output:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 13 of 142
Sitecore Commerce Connect 7.2
Usage Example:
var cartServiceProvider = new CartServiceProvider();
CreateOrResumeCart
Name: CreateOrResumeCart
Description: Initiate the creation of a shopping cart and in the process:
Tries to load persisted, potentially abandoned cart, if present
Trigger event in DMS
Enter user in Engagement Automation plan with ID of shopping cart.
Usage: Called when a shopping cart is needed upon visitor arrival to shop.
Signature: CreateOrResumeCartResult
CreateCart(CreateOrResumeCartRequest request)
Input: All four input parameters are used to search and match against existing carts for
the current visitor, but only two of them are mandatory.
UserId – Mandatory
CustomerId – Optional
CartName – Optional
ShopName – Mandatory
Output:
Cart – A Cart object instance which represent the shopping cart. In case
multiple carts already exists for the current visitor and it’s undecided which one
to return, then no cart is returned
IEnumerable<CartBase> - In case multiple carts already exists for the current
visitor and it’s undecided which one to return, then a list of CartBase objects are
returned
SystemMessages - Collection of messages from the external system.
Usage Example:
var cartServiceProvider = new CartServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 14 of 142
The Commerce Connect Developer's Guide
LoadCart
Name: LoadCart
Description: Gets the cart with given Cart ID on the specified shop. Calls the pipeline
"LoadCart". This method returns the full cart object with all cartlines associated.
Usage: Called when a specific cart is needed
Signature: LoadCartResult LoadCart(LoadCartRequest request)
Input:
CartId – required
ShopName – required
Output:
Cart – A cart object instance which represent the shopping cart that matches
the criteria specified in the request.
SaveCart
Name: SaveCart
Description: Saves the specified cart in the external system if supported as well as in
Sitecore EA state. Calls the pipeline "SaveCart".
Called from other service layer methods implicitly, but not called explicitly
Usage: Called when a specific cart needs to be persisted. The method should be
executed after any operation that modified the cart resulting in a change of cart.
It’s executed implicitly when update cart, adding, deleting or updating cart lines
as well as locking and un-locking the cart.
Signature: SaveCartResult SaveCart(SaveCartRequest request)
Input:
Cart – required
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var cartServiceProvider = new CartServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 15 of 142
Sitecore Commerce Connect 7.2
};
AddCartLines
Name: AddCartLines
Description: Responsibility is to add lines to cart.
Usage: Called when a list of cart lines is about to be added to the shopping cart. UI wise
when the user clicks the Add-To-Cart button.
Signature: AddCartLinesResult AddCartLines(AddCartLinesRequest
request)
Input:
Cart – Required - The cart must be unmodified. Any changes made to cart
instance will be disregarded. Only the cart Id and ShopName are considered for
retrieving and modifying the cart.
IEnumerable<CartLine> CartLines – Required - A collection of cart lines to
add
Output:
Cart - Cart object that represent the updated cart in the external system.
SystemMessages - Collection of messages from the external system
Usage Example:
var cartServiceProvider = new CartServiceProvider();
// Prepare parameters for getting cart for visitor ID Ivan in shop Autohaus
var createCartRequest = new CreateOrResumeCartRequest("Autohaus", "Ivan");
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 16 of 142
The Commerce Connect Developer's Guide
}
}
);
RemoveCartLines
Name: RemoveCartLines
Description: Responsibility is to remove lines from cart.
Usage: Called when one or more cart lines are about to be removed from the shopping
cart. UI wise when the user updates the cart by removing one or more lines.
Signature: RemoveCartLinesResult
RemoveCartLines(RemoveCartLinesRequest request)
Input:
Cart - Required. The cart must be unmodified. Any changes made to cart
instance will be disregarded. Only the cart Id and ShopName are considered for
retrieving and modifying the cart.
IEnumerable<CartLine> CartLines – Required - A collection of cart lines to
remove.
ExternalCartLineId, LineNumber or object reference can be used to identify the
line(s) to be removed.
The default Connect based implementation removes lines by object reference.
Typically
Output:
Cart - Cart object that represent the updated cart in the external system.
SystemMessages - Collection of messages from the external system
Usage Example:
var cartServiceProvider = new CartServiceProvider();
// Create cart with "Audi Q10", "BMW X7" and "Citroen C3"
var createCartRequest = new CreateOrResumeCartRequest("Autohaus", "John");
var cart = cartServiceProvider.CreateOrResumeCart(createCartRequest).Cart;
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 17 of 142
Sitecore Commerce Connect 7.2
UpdateCartLines
Name: UpdateCartLines
Description: Responsibility is to update lines on cart.
Usage: Occurs when a shopping cart is about to be updated referring to lines already in
the cart. UI wise it’s when the user updates the cart regarding a specific product.
Most typically it’s when
The quantity is changed
A service is added like insurance or shipping
Promotion code is added for a given product
Product is replaced with another variant
Signature: UpdateCartLinesResult
UpdateCartLines(UpdateCartLinesRequest request)
Input:
Cart - Required. The cart must be unmodified. Any changes made to cart
instance will be disregarded. Only the cart Id and ShopName are considered for
retrieving and modifying the cart.
IEnumerable<CartLine> CartLines – Required - A collection of cart lines to
update on cart
Output:
Cart – Cart object that represent the updated cart in the external system.
SystemMessages - Collection of messages from the external system.
Usage Example:
var cartServiceProvider = new CartServiceProvider();
// Create cart with "Audi Q10", "BMW X7" and "Citroen C3"
var createCartRequest = new CreateOrResumeCartRequest("Autohaus", "John");
var cart = cartServiceProvider.CreateOrResumeCart(createCartRequest).Cart;
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 18 of 142
The Commerce Connect Developer's Guide
{
ProductId = "BMW X7",
Price = new Price(10, "USD")
}
};
DeleteCart
Name: DeleteCart
Description: Responsibility is to delete a cart permanently:
The cart is deleted.
Trigger event in DMS telling the cart is deleted.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 19 of 142
Sitecore Commerce Connect 7.2
UpdateCart
Name: UpdateCart
Description: Responsibility is to pass an updated cart to the external commerce system
Trigger event in DMS telling the cart is being updated.
Usage: The method should be executed after any operation that modifies the cart,
typically when Adjustments have been added, removed or modified.
Signature: UpdateCartResult UpdateCart(UpdateCartRequest request)
Input:
Cart - Required - The cart to be updated. The cart must be unmodified. Any
changes made to cart instance will be disregarded. Only the cart Id and
ShopName are considered for retrieving and modifying the cart.
Cart Base – An instance of Cart Base containing the changes to be made to the
cart
Typically the only properties allowed to be modified would be: UserId,
CustomerId, CartName and potentially ShopName.
Whether IsLocked and CartStatus will be considered, depends on business logic
in the external commerce system.
Null values will not be considered, but blank values will
Output:
Cart – Cart object that represent the updated cart in the external system.
SystemMessages - Collection of messages from the external system.
Usage Example:
var cartServiceProvider = new CartServiceProvider();
// Create prefix.
var createCartRequest = new CreateOrResumeCartRequest("Autohaus", "Peter");
var cart = cartServiceProvider.CreateOrResumeCart(createCartRequest).Cart;
// Create the instance of the CartBase with properties that should be changed in
existing prefix.
var changes = new CartBase
{
CustomerId = "Customer Peter",
Name = "Peter's Cart",
ShopName = "Autohaus"
};
// Call service provider with prepared request and receive the result.
var result = cartServiceProvider.UpdateCart(updateCartRequest);
LockCart
Name: LockCart
Description: Responsibility is to set the cart in a locked state where it is ready to be
committed to an order but before any optional payment transaction is performed:
Set cart to locked and save it.
Trigger event in DMS telling the cart is in locked state.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 20 of 142
The Commerce Connect Developer's Guide
Usage Example:
var cartServiceProvider = new CartServiceProvider();
UnlockCart
Name: UpdateCartLines
Description: Responsibility is to set the cart in an unlocked state:
Set cart to unlocked and save it.
Trigger event in DMS telling the cart is in locked state.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 21 of 142
Sitecore Commerce Connect 7.2
MergeCart
Name: MergeCart
Description: Responsibility is to merge two specified carts:
Both carts must have identical shop names.
Both carts must have different ExternalIDs.
Cart1 and Cart2 cart line items are merged and returned
Usage: Is typically called when a user logs in and the system notices an anonymous
cart exists.
Signature: CartResult MergeCart([NotNull] MergeCartRequest request)
Input:
UserCart – Required
AnonymousCart - Required
Output:
Cart – Cart object representing the merged user cart.
Usage Example:
var cartServiceProvider = new CartServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 22 of 142
The Commerce Connect Developer's Guide
cartServiceProvider.DeleteCart(new DeleteCartRequest(anonymousCart));
AddParties
Name: AddParties
Description: Responsibility is to add parties to a cart
Usage: Is typically called when adding party information to a cart
Signature: AddPartiesResult AddParties([NotNull] AddPartiesRequest
request)
Input:
Cart – Required
Parties -- Required
Output:
Parties – The read only list of all parties associated with this cart after the add
Usage Example:
var cartServiceProvider = new CartServiceProvider();
RemoveParties
Name: RemoveParties
Description: Responsibility is to remove parties from a cart
Usage: Is typically called when removing party information
Signature: RemovePartiesResult RemoveParties([NotNull]
RemovePartiesRequest request)
Input:
Cart – Required
Parties – Required – The list of parties to remove from the cart
Output:
Parties – The read only list of all parties associated with this cart after the
remove
Usage Example:
var cartServiceProvider = new CartServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 23 of 142
Sitecore Commerce Connect 7.2
UpdateParties
Name: UpdateParties
Description: Responsibility is to update a list of parties within a cart
Usage: Is typically called when parties need to be updated
Signature: UpdatePartiesResult UpdateParties([NotNull]
UpdatePartiesRequest request)
Input:
Cart – Required
Parties – Required – The list of parties to update in the cart
Output:
Parties – The read only list of all parties associated with this cart after the
update
Usage Example:
var cartServiceProvider = new CartServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 24 of 142
The Commerce Connect Developer's Guide
Country = "Canada"
};
AddPaymentInfo
Name: AddPaymentInfo
Description: Responsibility is to add payment information to a cart
Usage: Is typically called during a checkout flow to add the payment info for processing
of an order.
Signature: AddPaymentInfoResult AddPaymentInfo([NotNull]
AddPaymentInfoRequest request)
Input:
Cart – Required
Payments – Required – a list of payment info to be added to the cart
Output:
Payments – The read only list of payments associated with the cart after the
add
Usage Example:
var cartService = new CartServiceProvider();
var cart = cartService.CreateOrResumeCart(new
CreateOrResumeCartRequest("MyShop", "Me")).Cart;
RemovePaymentInfo
Name: RemovePaymentInfo
Description: Responsibility is to remove payment information from a cart
Usage: Is typically called when a user wants to change their payment information
Signature: RemovePaymentInfoResult RemovePaymentInfo([NotNull]
RemovePaymentInfoRequest request)
Input: Cart – Required
Payments – Required – a list of payment info to be removed from the cart
Output: Payments – The read only list of payments associated with the cart after the
remove
Usage Example:
var cartService = new CartServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 25 of 142
Sitecore Commerce Connect 7.2
AddShippingInfo
Name:
Description: Responsibility is to add shipping information to a cart
Usage: Is typically called during a checkout flow to add the shipping info for processing
of an order.
Signature: AddShippingInfoResult AddShippingInfo([NotNull]
AddShippingInfoRequest request)
Input:
Cart – Required
ShippingInfo – Required – a list of shipping info to add to the cart
Output:
ShippingInfo – A read only list of shipping info associated with the cart after the
add
Usage Example:
var cartService = new CartServiceProvider();
var cart = cartService.CreateOrResumeCart(new
CreateOrResumeCartRequest("MyShop", "Me")).Cart;
RemoveShippingInfo
Name:
Description: Responsibility is to remove shipping information from a cart
Usage: Is typically called during a checkout flow to remove the shipping info for
processing of an order.
Signature: RemoveShippingInfoResult RemoveShippingInfo([NotNull]
RemoveShippingInfoRequest request)
Input:
Cart – Required
ShippingInfo – Required – a list of shipping info to remove from the cart
Output:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 26 of 142
The Commerce Connect Developer's Guide
ShippingInfo – A read only list of shipping info associated with the cart after the
remove
Usage Example:
var cartService = new CartServiceProvider();
var cart = cartService.CreateOrResumeCart(new
CreateOrResumeCartRequest("MyShop", "Me")).Cart;
GetCarts
Name: GetCarts
Description: The pipeline is responsible for performing a search against all carts and return a
list of CartBase instances for carts found, matching the specified search criteria.
The carts might be persisted in both the ECS and/or EA state.
Depending on the location of the main cart repository, the processors configured
for the pipeline will differ between different Connect provider implementations.
Usage: Called via method GetCarts on the Connect API when searching for carts.
Args:
Request - Contains the search criteria: UserID, CustomerID, CartName,
CartStatus, IsLocked, and ShopName. Is set prior to calling the pipeline.
Response - Contains the cart objects. Is read after the pipeline is executed.
Processors: GetCartsFromEAState –
Responsibility - To execute query against carts stored in EA states across all
users which matches the input parameters UserID, CustomerID, CartName, and
ShopName.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 27 of 142
Sitecore Commerce Connect 7.2
Usage: The processor is generic for searching in EA state and returning lists of
carts. If the external commerce system supports persisting carts then the
processor(s) should be replaced by the custom GetCarts processor querying
against ECS, see below.
GetCarts –
Responsibility - To execute a query against carts stored in the external
commerce system which matches the input parameters UserID, CustomerID,
CartName, and ShopName.
Usage: If ECS supports persistence of carts, then this processor replaces the
default Connect processor(s) querying against EA state
If not supported, EA state and GetCartsFromEAState processor(s) must be
used instead
CreateOrResumeCart
Name: CreateOrResumeCart
Description: Initiates the creation of a shopping cart and in the process to:
Load persisted, potentially abandoned cart, if present and return that
Trigger event in DMS if new cart is created
Enter user in Engagement Automation plan with ID of new shopping cart
The pipeline will call different pipelines depending on whether an existing cart is
found and can be resumed or not.
Usage: Called via method CreateOrResumeCart on the Connect API.
Args:
Request - Contains the essential cart parameters also used to search for
existing cart. Is set prior to calling the pipeline.
Response - Contains the cart objects or a list of CartBase instance in case
multiple carts exists that matches the given parameters. Is read by the Cart
Provider after the pipeline is called.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 28 of 142
The Commerce Connect Developer's Guide
Processors:
FindCartInEAState –
Responsibility: To locate a cart in the current visitors EA state which matches
the input parameters UserID, CustomerID, CartName, and ShopName.
If a match is found then the Cart ID is set in custom pipeline argument CartID
(args.CustomData[“CartID”])
The processor is needed to retrieve the cart ID of the existing cart before
LoadCart can be called
Usage: The processor is generic for searching in EA state and returning cart ID
for a cart matching the given input parameters.
RunLoadCart –
Responsibility: Is to call pipeline LoadCart and load a cart with given ID. The ID
is specified in parameter CartId.
If cart was not found, cart is null or empty in pipeline arguments
Usage: Mandatory. The processor is generic for calling pipeline LoadCart that
loads a cart by CartID and can be used in other pipelines.
It’s assumed that the CartID to be used for loading cart is stored in customer
pipeline arg “CartID” (args.CustomData[“CartID”])
Pipeline RunResumeCart is assuming that the cart to be resumed is loaded
before it’s executed
RunResumeCart –
Responsibility: Is to call pipeline ResumeCart in order to resume a loaded cart if
possible.
It’s expected that a cart is present in pipeline arguments.
If no cart is present, then the processor will not call pipeline ResumeCart
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 29 of 142
Sitecore Commerce Connect 7.2
RunCreateCart –
Responsibility: Is to call pipeline CreateCart in order to create a new cart.
It’s expected that no cart is present in pipeline arguments.
If a cart is present, then the processor will not call pipeline CreateCart
CreateCart
Name: CreateCart
Description: Creates and saves a new shopping cart and in the process:
Trigger event in DMS for new cart
Enter visitor into Engagement Automation plan with new shopping cart
Usage: Called from pipeline CreateOrResumeCart as one of the branches when no cart
exists
Args:
Request - Contains the same parameters as CreateOrResumeCart pipeline. Is
carried over from CreateOrResumeCart pipeline.
Response - Contains the cart objects. Is read by the Cart Provider after the
pipeline is called.
Processors:
CreateCart –
Responsibility: Is to create a new cart, initialize values from arguments and
return it.
If a cart already exists in pipeline arguments, it’s ignored and will be overwritten.
Usage: Optional. The default processor is generic for creating a domain model
cart and initialize values, but it never calls the ECS.
In some integration scenarios it will be relevant to call the ECS at this point in
time to create a new cart. In that case this processor can be used as a base
class and extended, as it does initialize the cart domain object, or it can be
replaced altogether.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 30 of 142
The Commerce Connect Developer's Guide
In other integration scenarios the ECS will not be called at this point in time.
Instead it will likely be called when manipulating cart lines or only when saving
the cart. It depends on the system being integrated with.
AddVisitorToEAPlan –
Responsibility: Is to add the current visitor to an EA plan, in this case the
Abandoned Cart EA plan.
The current implementation supports multiple shops. By using an
eaPlanProvider the plan and state IDs can be retrieved. By default the
eaPlanProvider tries to find an EA plan with a name prefixed with the site name,
e.g. the ECS could contain a site named Autohaus, so according to naming
convention the EA plan must be named “Autohaus Abandoned Cart”. If a
different EA plan name is used, it can be configured on the site definition item.
Usage: Optional. The processor is generic for adding the visitor to an EA plan,
but it expects to be in the CreateCart pipeline with the CreateCartRequest object
in pipeline args.
The plan and state IDs are retrieved from the eaPlanProvider, which is specified
in the processor parameter and instantiated via Sitecore Factory.
RunSaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
TriggerPageEventForResultCart –
Responsibility: Is to trigger a specified page event and register the cart values:
ExternalCartId, UserId, CartName, CartStatus
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 31 of 142
Sitecore Commerce Connect 7.2
Usage: Optional. The processor is generic for triggering a page event with the
specified parameters from the cart stored in the args.Result argument.
The event to be triggered is specified in processor parameter PageEventName
The event text to be used is specified in processor parameter PageEventText
ResumeCart
Name: CreateOrResumeCart
Description: Validates and resumes the cart specified in arguments and in the process:
Change the state to the initial state in abandoned cart Engagement
(reboot)
Updates the cart state
Saves the cart
Trigger event in DMS
Usage: Called via the Connect API from Sitecore.
Args:
Request - Contains the search criteria. Is set by the Cart Provider prior to calling
the pipeline.
Response - Contains the cart objects. Is read by the Cart Provider after the
pipeline is called.
Processors:
CheckCanBeResumed –
Responsibility: Is to check if given cart can be resumed. If visitor is not already in
the abandoned cart EA plan the pipeline is aborted and if the visitor is already in
the initial state, it’s also aborted.
Also sets three parameters in pipeline args that are used in the processors listed
in parentheses:
CartSourceStateId (MoveVisitorToInitialState)
CartDestinationStateId (MoveVisitorToInitialState)
PreviousStateName (TriggerPageEventForResumedCart)
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 32 of 142
The Commerce Connect Developer's Guide
Usage: Mandatory. The processor checks if the visitor is already in the plan or
not. If not there’s no cart to resume.
ChangeCartStatus –
Responsibility: Is to update the cart status field with the value “InProcess” taken
from constant CartStatus.InProcess
Usage: Optional. The processor is generic but the status value set on cart is
fixed to InProcess.
Customization: The processor could be updated to take the state value from
parameter instead of constant in code.
MoveVisitorToInitialState –
Responsibility: Is to move the current visitor between two states of an EA plan,
in this case the Abandoned Cart EA plan.
Usage: Optional. The processor is generic for moving a visitor to initial state of
EA plan, but it expects to be in the CreateCart pipeline with the
CreateCartRequest object in pipeline args.
The source and destination state IDs are read from custom pipeline arguments:
“CartSourceStateId”
”CartDestinationStateId”
RunSaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Mandatory. The processor is generic for calling pipeline SaveCart and
can be used in other pipelines.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 33 of 142
Sitecore Commerce Connect 7.2
TriggerPageEventForResumedCart –
Responsibility: Is to trigger a specified page event when resuming the cart and
register the cart values:
ExternalCartId, UserId, CartName, CartStatus, StateName (containing
the previous state that it was moved from)
Usage: Optional. The processor is specific for resuming a cart and for triggering
a page event with the specified parameters from the cart stored in the
args.Result argument.
The value for previous state is found in pipeline args “PreviousState” and is
inserted in the page event text along with the ExternalCartId
The event text to be used is specified in processor parameter PageEventText
LoadCart
Name: LoadCart
Description: Loads the cart that matches the specified criteria, e.g. ID and ShopName.
This pipeline is responsible for reading data for a specific cart that is managed
by the commerce system. This pipeline reads the cart data from the commerce
system and/or from Engagement Automation state.
Usage: 1. Called directly via the Connect API method LoadCart from Sitecore.
2. Called indirectly via the Connect API methods CreateOrResumeCart
Args:
Request - Contains the criteria that determine which cart should be retrieved. Is
set prior to calling the pipeline.
Response - Contains the cart object after the pipeline is called.
Processors:
LoadCartFromEAState –
Responsibility:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 34 of 142
The Commerce Connect Developer's Guide
Load existing cart from EA state with given CartID and in the shop specified with
parameter ShopName
For performance reasons, the default implementation works as follows:
First carts are loaded from current visitor EA state data and filtered by
the given parameters. If found, it is written to pipeline result args and
execution stops.
If not found, then all carts across all visitors are loaded and filtered by
the given parameters. Searching across all visitors is an expensive
operation.
If cart is found in EA state, it’s written to pipeline Result arg
LoadCart –
Responsibility:
Load existing cart from ECS with given CartID and in the shop specified with
parameter ShopName
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 35 of 142
Sitecore Commerce Connect 7.2
If cart is found in external commerce system it can overwrite or merge with the
cart already stored in pipeline Response arg. It’s up to the Connect provider
implementation with the ECS.
Ownership: The processor is provided by the ECS
SaveCart
Name: SaveCart
Description: Saves the cart both to the external commerce system and in Engagement
Automation state.
Usage: Called from other service layer methods, but rarely, if never called explicitly
Args:
Request - Contains the criteria that determine which cart should be retrieved. Is
set prior to calling the pipeline.
Response - Contains the cart object after the pipeline is called.
Processors:
SaveCart –
Responsibilitty:
Saves the given cart to the ECS
In some ECS implementations the SaveCart pipeline is the first and only place
the ECS system is provided a cart from Connect.
Since the ECS is the primary repository for carts, it’s assumed that the unique
CartID key is provided by the ECS.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 36 of 142
The Commerce Connect Developer's Guide
SaveCartToEAState –
Responsibility:
Saves the cart to EA state
AddCartLines
Name: AddCartLines
Description: This pipeline is responsible for adding a new line to the shopping cart and
recording a corresponding page event in DMS. This happens when a product is
added to the cart.
Usage: Called from Sitecore.
Args:
Request - Contains the cart to be updated, along with what lines should be
added to the cart.
Is set prior to calling the pipeline.
Response - Contains the updated cart object after the pipeline is called.
Processors:
CheckIfLocked –
Responsibility: Checks if the cart is locked and abort the pipeline if so, returning
SystemMessages to signal the locked state
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 37 of 142
Sitecore Commerce Connect 7.2
Usage: Optional. The processor is generic for checking if cart is locked. The
processor is and should be used in all pipelines that potentially modify the cart
content
AddLinesToCart –
Responsibility: Adds the given lines to the provided cart.
Calling this method will always add the given lines to the existing collection of
lines in the cart, even if lines already exist on the cart containing the same
product. Alternatively UpdateLinesOnCart can be called if a line already exists
with a product where the quantity simply should be adjusted.
Usage: Optional. The processor is generic for adding lines to cart, but potentially
should be replaced by an ECS specific implementation.
RunSaveCart -
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
TriggerPageEventsForCartLines –
Responsibility: Is to trigger a specified page event when adding lines to cart and
register the values:
Product ID, QTY, Price and Currency
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 38 of 142
The Commerce Connect Developer's Guide
Usage: Optional. The processor is generic for triggering a page event when
modifying cart lines
RemoveCartLines
Name: RemoveCartLines
Description: Responsibility is to remove cart lines from cart
Usage: Called from Sitecore.
Args:
Request - Contains the cart to be updated along with the cart lines to be
removed
Is set prior to calling the pipeline.
Response - Contains the updated cart object after the pipeline is called.
Processors:
CheckIfLocked –
Responsibility: Checks if the cart is locked and abort the pipeline if so, returning
an SystemMessages to signal the locked state
Usage: Optional. The processor is generic for checking if cart is locked. The
processor is and should be used in all pipelines that potentially modify the cart
content
RemoveLinesFromCart –
Responsibility: Removes the given lines from the provided cart.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 39 of 142
Sitecore Commerce Connect 7.2
The list of lines to remove must be references directly to the lines in the
CartLines collection on the cart. They will be removed by reference:
cart.CartLines = cart.CartLines.Except(request.CartLines).ToList();
Usage: Optional. The processor is generic for removing lines from cart, but
potentially should be replaced by an ECS specific implementation.
SaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
TriggerPageEventsForCartLines –
Responsibility: Is to trigger a specified page event when adding lines to cart and
register the values:
Product ID, QTY, Price and Currency
Usage: Optional. The processor is generic for triggering a page event when
modifying cart lines
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 40 of 142
The Commerce Connect Developer's Guide
UpdateCartLines
Name: UpdateCartLines
Description: Responsibility is to update lines on cart
Usage: Called from Sitecore.
Args:
Request - Contains the cart along with the cart lines to be updated
Is set prior to calling the pipeline.
Response - Contains the updated cart object after the pipeline is called.
Processors:
CheckIfLocked –
Responsibility: Checks if the cart is locked and abort the pipeline if so, returning
an SystemMessages to signal the locked state
Usage: Optional. The processor is generic for checking if cart is locked. The
processor is and should be used in all pipelines that potentially modify the cart
content
UpdateLinesOnCart –
Responsibility: To update the given lines on the provided cart.
The default implementation doesn’t process the lines on the original cart, but
simple return the cart that was passed in and that already had its Cartlines
updated.
Hence, the list of updated lines must be references to the CartLines collection
on the cart.
Usage: Optional. The processor is generic for updating lines on cart, but
potentially should be replaced by an ECS specific implementation.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 41 of 142
Sitecore Commerce Connect 7.2
SaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
TriggerPageEventsForCartLines –
Responsibility: Is to trigger a specified page event when adding lines to cart and
register the values:
Product ID, QTY, Price and Currency
The event to be triggered is passed in as parameter as well as the Page Event
Text. In this case the event is “Lines Updated On Cart”. The Page Event text is
localized by looking up in Sitecore dictionary.
Usage: Optional. The processor is generic for triggering a page event when
modifying cart lines
DeleteCart
Name: DeleteCart
Description: Responsibility is to delete a cart permanently:
The cart is deleted.
Trigger event in DMS telling the cart is deleted.
Usage: Called from Sitecore.
Args:
Request - Contains the cart to be deleted
Is set prior to calling the pipeline.
Response – SystemMessages
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 42 of 142
The Commerce Connect Developer's Guide
Processors:
CheckIfLocked –
Responsibility: Checks if the cart is locked and abort the pipeline if so, returning
an SystemMessages to signal the locked state
Usage: Optional. The processor is generic for checking if cart is locked. The
processor is and should be used in all pipelines that potentially modify the cart
content
DeleteCart –
Responsibility: Deletes and removes cart from storage in ECS
Usage: Mandatory
DeleteCartFromEAState –
Responsibility: Locates and deletes cart from EA state
TriggerPageEventForRequestCart –
Responsibility: Is to trigger a specified page event when deleting a cart and
register the values:
ExternalCartId, UserId, CartName, CartStatus
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 43 of 142
Sitecore Commerce Connect 7.2
Usage: Optional. The processor is generic for triggering a page event for
processors that takes an argument based on parameter type CartRequest
Ownership: The processor is provided with Connect
UpdateCart
Name: UpdateCart
Description: Responsibility is to pass an updated cart to the external commerce system
Trigger event in DMS telling the cart is being updated.
Usage: Called from Sitecore.
Args:
Request - Contains the cart and the data to be updated in Cart Base
Is set prior to calling the pipeline.
Response - Contains the updated cart object after the pipeline is called.
Processors:
CheckIfLocked –
Responsibility: Checks if the cart is locked and abort the pipeline if so, returning
an SystemMessages to signal the locked state
Usage: Optional. The processor is generic for checking if cart is locked. The
processor is and should be used in all pipelines that potentially modify the cart
content
UpdateCart –
Responsibility: To update the cart with the updated values of the cart body
(CartBase object only, not lines etc.).
The default implementation will update all default properties on CartBase except
“CustomerID”; “CartName”, “ShopName”. Everything including null and black
values are included.
Usage: Optional. The processor is generic for updating the cart body.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 44 of 142
The Commerce Connect Developer's Guide
TriggerPageEventForRequestCartChanges –
Responsibility: Is to trigger a specified page event when deleting a cart and
register the values:
CustomerId, CartName, ShopName
Usage: Optional. The processor is generic for triggering a page event for
processors that takes an argument based on parameter type
UpdateCartRequest
RunSaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
LockCart
Name: LockCart
Description: Responsibility is to set the cart in a locked state and prevent any modifications
Usage: Called from Sitecore.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 45 of 142
Sitecore Commerce Connect 7.2
Args:
Request - Contains the cart to be locked
Is set prior to calling the pipeline.
Response - Contains the cart object after the pipeline is called.
Processors:
LockCart –
Responsibility: Is to set the cart to locked state (IsLocked = true)
Customization: The default implementation does not call the ECS. It might be
relevant to overwrite or replace the implementation to call the ECS when
locking.
RunSaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
TriggerPageEventForRequestCart –
Responsibility: Is to trigger a specified page event when deleting a cart and
register the values:
ExternalCartId, UserId, CartName, CartStatus
Usage: Optional. The processor is generic for triggering a page event for
processors that takes an argument based on parameter type CartRequest
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 46 of 142
The Commerce Connect Developer's Guide
UnlockCart
Name: UnlockCart
Description: Responsibility is to set the cart in an unlocked state
Usage: Called from Sitecore.
Args:
Request - Contains the cart to unlock
Is set prior to calling the pipeline.
Response - Contains the cart object after the pipeline is called.
Processors:
UnlockCart –
Responsibility: Is to set the cart to not-locked state (IsLocked = false)
Customization: The default implementation does not call the ECS. It might be
relevant to overwrite or replace the implementation to call the ECS when
unlocking.
RunSaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
TriggerPageEventForRequestCart –
Responsibility: Is to trigger a specified page event when deleting a cart and
register the values:
ExternalCartId, UserId, CartName, CartStatus
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 47 of 142
Sitecore Commerce Connect 7.2
Usage: Optional. The processor is generic for triggering a page event for
processors that takes an argument based on parameter type CartRequest
MergeCart
Name: MergeCart
Description: Responsibility is to merge a User cart with an Anonymous cart.
Usage: Called from Sitecore.
Args:
Request - Contains the User cart and the Anonymous cart.
Response - Contains the merged User cart.
Processors:
MergeCart –
Responsibility: is to merge the User and Anonymous carts.
Customization: The default implementation does not call the ECS. It might be
relevant to overwrite or replace the implementation if custom merging rules are
required.
RunSaveCart –
Responsibility: Is to call pipeline SaveCart which saves the specified cart.
Usage: Optional, but should always be called when changes have been made to
the cart, which is the case here. The processor is generic for calling pipeline
SaveCart and can be used in other pipelines.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 48 of 142
The Commerce Connect Developer's Guide
RunDeleteCart -
Responsibility: Is to call pipeline DeleteCart which deletes the specified cart,
which in this case is the cart specified in parameter Anonymous Cart
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 49 of 142
Sitecore Commerce Connect 7.2
2.2 Pricing
Note
The information passed in the service layer from Connect framework must be enough to meet the
requirements of the external commerce system in order to do its business logic. The Connect
framework doesn’t perform business logic and therefore the information passed back from the
external commerce system is for informational purposes.
Class: Price
Price represents the amount that a product costs. The price is used to determine what a customer has
to pay for a single product, but the total cost is represented by the Total object, which takes additional
information into consideration like tax, shipping etc.
Price is returned by the Pricing Service Provider as a part of the output from the GetProductPrices
method. A product may have multiple prices and multiple prices might be returned from a single call.
Hence a collection of Price objects is the output from the Pricing Service Provider when a single
product is priced.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 50 of 142
The Commerce Connect Developer's Guide
Note
The condition information is used for presentation and triggering engagement and not for calculation,
so the value can be an arbitrary string.
Campaign prices
In case of ConditionType Date the value will
typically either be:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 51 of 142
Sitecore Commerce Connect 7.2
Class: Total
Total represents the total price a customer will have to pay for a product, cart-line or entire cart at a
specific point in time including charges, discounts, coupon codes, tax and shipping etc.
Total is the output from the Pricing Service Provider when a collection of products is priced as a unit
(aka bundling). It provides a total price for the entire collection.
Class: TaxTotal
TaxTotal represents the tax that applies to something with a Total. Any object with a Total also has a
TaxTotal.
Class: TaxSubtotal
TaxSubtotal represents a specific tax that applies to an object, and the amount of the tax. This level of
granularity is required in some countries.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 52 of 142
The Commerce Connect Developer's Guide
GetProductPrices
// You can use the GetProductPrices to get the prices of a specific type.
// The following sample shows an example of retrieving a price of type Customer
// opposed to the default List price type:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 53 of 142
Sitecore Commerce Connect 7.2
GetProductBulkPrices
// Result contains a dictionary of <key, value> pairs, where the key is the
// product ID and the value represent the corresponding Price.
var price = result.Prices["Audi A8L"].Amount;
GetCartTotal
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 54 of 142
The Commerce Connect Developer's Guide
GetProductPrices
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 55 of 142
Sitecore Commerce Connect 7.2
Name: GetProductPrices
Description: Gets the price object that matches the specified criteria.
This pipeline is responsible for reading pricing data from a commerce system.
This pipeline requests product pricing information from the commerce system
and then converts the output into the proper Connect format.
Usage: Called by the Pricing Service Provider.
Args
Parameters:
Request - Includes the search criteria. Is set by the
Pricing Service Provider prior to calling the
pipeline.
Response - Includes the price collection object. Is read
by the Pricing Service Provider after the
pipeline is called.
Processors:
GetProductPrices - Retrieves the prices specified by
request.ProductTypeIds.
GetProductBreakPrices
Name: GetProductBreakPrices
Description: Gets the break price objects with corresponding conditions that matches the
specified criteria.
This pipeline is responsible for reading break pricing data from a commerce
system. This pipeline requests product pricing information from the commerce
system and then converts the output into the proper Connect format.
Usage: Called by the Pricing Service Provider.
Args
Parameters:
Request - Includes the search criteria. Is set by the
Pricing Service Provider prior to calling the
pipeline.
Response - Includes the price collection object. Is read
by the Pricing Service Provider after the
pipeline is called.
Processors:
EvaluatePriceConditions In a case where multiple prices exist for the
- product, determine which price applies.
With break prices several prices needs to
be returned and conditions created.
It’s the responsibility of this processor to
build the conditions with the associated
prices.
For more info, see definition of condition
GetCartTotals
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 56 of 142
The Commerce Connect Developer's Guide
Name: GetCartTotals
Description: Gets the totals object that matches the specified criteria.
This pipeline is responsible for reading pricing data from a commerce system.
This pipeline converts the contents of a Connect cart into a format the
commerce system can understand, requests the commerce system calculate
the totals, and then converts the output into the proper Connect format.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 57 of 142
Sitecore Commerce Connect 7.2
2.3 Order
Class: Order
The Order class is responsible for representing an order.
Class: OrderHeader
The OrderHeader class is responsible for representing an order header.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 58 of 142
The Commerce Connect Developer's Guide
SubmitVisitorOrder
Name: SubmitVisitorOrder
Description: Creates an order based on the shopping cart. Calls the pipeline
"SubmitVisitorOrder"
Usage: Called from Sitecore when visitor is submitting the shopping cart to create an
order.
Signature: SubmitVisitorOrderResult
SubmitVisitorOrder(SubmitVisitorOrderRequest request)
Input:
Cart – Cart. An instance of the shopping cart
Output:
Order – Cart.
In case of success, an order is returned and because order is inherited from Cart
that will work fine but it needs to be cast as an order
In case of failure, an instance of the cart object is returned, potentially modified
and augmented with more data and error comments
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 59 of 142
Sitecore Commerce Connect 7.2
cartService.SaveCart(new SaveCartRequest(cart));
GetVisitorOrder
Name: GetVisitorOrder
Description: Get the order by Id placed by the visitor. Calls the pipeline " GetVisitorOrder"
Usage: Called from Sitecore when order details are needed for specific order.
Signature: GetVisitorOrderResult GetVisitorOrder(GetVisitorOrderRequest request)
Input:
ShopName –
The name of the shop
OrderId –
The ID of the order
CustomerID – Mandatory
The ID of the customer / visitor
If the customer ID is not provided there is a potential security risk, that any
visitor can access orders from all customers
Output:
Order – An instance of the order object is returned. The order object is created
by the external commerce system.
SystemMessages - Collection of messages from the external system.
Usage Example:
var orderService = new OrderServiceProvider();
GetVisitorOrders
Name: GetVisitorOrders
Description: Get the order summary data of orders placed by the given visitor. Calls the
pipeline " GetVisitorOrders"
Usage: Called from Sitecore when order history is needed for visitor.
Signature: GetVisitorOrdersResult GetVisitorOrders(GetVisitorOrdersRequest
request)
Input:
ShopName -
The name of the shop
CustomerId – Id of the buyer customer party
Output:
IReadOnlyCollection<OrderBase> – An instance of the order object is
returned. The order object is created by the external commerce system.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 60 of 142
The Commerce Connect Developer's Guide
VisitorCancelOrder
Purpose is for a visitor to cancel an existing order if the option is present on the web shop and if
business logic does not prevent it, e.g. order has already been fulfilled and/or shipped.
Typically triggered when showing order details to the customer launched from the order history view
and the customer chooses to cancel the order
Name: VisitorCancelOrder
Description: Is used to cancel an order placed by the visitor. The decision on whether the
order is cancelled or not lies in business logic in the external commerce system.
Typically an order cannot be cancelled once its shop owner has started
fulfilling/processing it.
If the order cannot be cancelled, it must be reflected in the returned
SystemMessages
Usage: Called from Sitecore
Signature: VisitorCancelOrderResult VisitorCancelOrder(VisitorCancelOrderRequest
request)
Input:
ShopName – Mandatory
The name of the shop
OrderId – Mandatory
The ID of the order
CustomerID – Mandatory
The ID of the customer / visitor
If the customer ID is not provided there is a potential security risk, that any
visitor can access orders from all customers
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var orderService = new OrderServiceProvider();
SubmitVisitorOrder
Name: VisitorSubmitOrder
Description: This pipeline is responsible for creating an order. The orders are managed by
the commerce system.
Usage: Called from Sitecore.
Args:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 61 of 142
Sitecore Commerce Connect 7.2
Request - Contains cart with the Shop name, cart, customer ID and customer
party IDs for buyer (shipping) and accounting (Invoice).
Response - Contains the order object.
Processors: CreateOrder – Creates an order in the external commerce system based on the
given parameters
Note: If an error occurs during processing of the cart, the Success property of
the SubmitVisitorOrderResult is set to false
GetVisitorOrders
Name: GetVisitorOrders
Description: Gets a list of orders for the specified customer
Usage: Called from Sitecore.
Args:
Request – ShopName and CustomerID
Response – A list of OrderBase objects
Processors:
GetVisitorOrdersFromECS–
Responsibility:
Get the list of orders for the specified customer from the ECS. It must be
possible to have the ECS and Sitecore installed in different locations, so it must
be possible to access remotely.
Usage: The processor is mandatory
Ownership: The processor is provided with the ECS connector integrating with
Connect
TriggerPageEvent –
Responsibility: Trigger the Connect specific page event Visitor Viewed Order
History along with information about the ShopName and Customer ID
Usage: Mandatory.
Customization: Not needed, but can be overwritten if other values from the order
should be registered with the page event
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 62 of 142
The Commerce Connect Developer's Guide
GetVisitorOrder
Name: GetVisitorOrder
Description: Gets the order by Id placed by the visitor. Executed from method
"GetVisitorOrder"
Usage: Called from Sitecore.
Args:
Request – ShopName and Order ID
Response – An instance of an order
Processors:
GetVisitorOrdersFromECS–
Responsibility: Get the order details for the specified order ID from the ECS.
Ownership: The processor is provided with the ECS connector integrating with
Connect
TriggerPageEvent –
Responsibility: Trigger the Connect specific page event Visitor Viewed Order
Details along with information about the ShopName, Order ID and total order
amount
Usage: Mandatory.
Customization: Overwrite the processor if other values from the order should be
registered
VisitorCancelOrder
Name: VisitorCancelOrder
Description:
Ca Called when a visitor order is being cancelled
Usage: Called from Sitecore.
Args:
Request – OrderId, CustomerId and ShopName
Response – an instance of the order
Processors:
VisitorCancelOrderFromECS–
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 63 of 142
Sitecore Commerce Connect 7.2
Responsibility: Get the order details for the specified order ID from the ECS.
Ownership: The processor is provided with the ECS connector integrating with
Connect
TriggerPageEvent –
Responsibility: Trigger the Connect specific page event Visitor Cancelled Order
Details along with information about the ShopName, Order ID and total order
amount
Usage: Mandatory.
Customization: Overwrite the processor if other values from the order should be
registered
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 64 of 142
The Commerce Connect Developer's Guide
2.4 Inventory
Note: The domain model consists of classes that make up the contracts with the external system. The
contracts are defined as classes instead of interfaces to allow the model to be easily extended later if
needed. This follow the best practice guidelines defined in the book Framework Design Guidelines.
Default implementation of the contracts are delivered as part of Connect. If an actual Connect
provider with an external commerce system contains more functionality that provided by default, the
implementation can be replaced. All instantiation of actual classes will be handled through
dependency injection.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 65 of 142
Sitecore Commerce Connect 7.2
Class: StockInformation
StockInformation is used as a strongly typed composite return value for service method
GetStockInformation.
Class: OrderableInformation
OrderableInformation is used as a strongly typed composite return value for service methods
GetPreOrdableInformation and GetBackOrderableInformation.
Class: IndexStockInformation
IndexStockInformation is used as a strongly typed composite value used in pipeline
StockStatusForIndexing when indexing products and including basic stock information.
The entity inherits from the base entity StockLocations. In the table, the inherited properties are
marked in Italics
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 66 of 142
The Commerce Connect Developer's Guide
Class: StockInformationUpdate
StockInformationUpdate is used as a strongly typed composite return value from method
GetBackInStockInformation to indicate the product and the locations where it will be back in stock
optionally along with availability date and count.
Class: StockInformationUpdateLocation
StockInformationUpdateLocation is used as a strongly typed value nested only into
StockInformationUpdate returned from method GetBackInStockInformation to indicate the locations
where the product will be back in stock optionally along with availability date and count.
Class: StockDetailsLevel
It is anticipated that there is a performance related difference between obtaining a simple stock status
and getting the actual stock count. In order to allow for flexibility it is possible to specify the level of
details that are requested.
Class StockDetailsLevel is used as a strongly typed request parameter for service method
GetStockInformation to indicate the level of stock details that is requested. Using a strongly typed
parameter will ease the use of the API for solution developers. The following example illustrates the
use of the class as an enum-like parameter.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 67 of 142
Sitecore Commerce Connect 7.2
The following table contains the list of default StockDetailsLevel options. Below is an example of how
the list of options can be extended.
The class is introduced as an extensible enum. In order to extend and customize the
StockDetailsLevel options:
public class MyECSStockDetailsLevel : StockDetailsLevel
{
public const int MyCustomDetailLevel = 4;
public MyECSStockDetailsLevel (int value) : base(value)
{ }
}
Class: StockStatus
Class StockStatus is used as a strongly typed value to indicate stock status. Using a strongly typed
value will ease the use of the API for solution developers. The following example illustrates the use of
the class as an enum-like parameter.
StockInformation stockInformation = GetStockInformation(
new StockInformationRequest { shopName = “MyShop”;
products = new list<string> { “Aw123x” };
detailsLevel = StockDetailsLevel.Status
}).Result.StockInformation[0];
If (stockInformation.Status == StockStatus.PreOrderable)
{
// Do work
}
The following table contains the list of default StockStatus options. Below is an example of how the
list of options can be extended.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 68 of 142
The Commerce Connect Developer's Guide
The class is introduced as an extensible enum. In order to extend and customize the
StockDetailsLevel options:
public class MyECSStockStatus : StockStatus
{
public const int MyCustomStatus = 4;
public MyECSStockStatus (int value) : base(value)
{ }
}
Class: InventoryProduct
Class InventoryProduct is used as a strongly typed value to identify a product. Using a strongly typed
value will ease the use of the API for solution developers.
Class: StockLocations
StockLocations is used as a strongly typed composite value used in pipeline
GetProductStockLocations when retrieving locations for a particular product.
StockLocations is also used as the base entity
GetStockInformation
Name: GetStockInformation
Description: Retrieves different levels of stock information from the ECS
Calls the pipeline "GetStockInformation".
Usage: Called from Sitecore when stock information is needed for a list of specified
products
Signature: GetStockInformationResult
GetStockInformation(GetStockInformationRequest request)
Input:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 69 of 142
Sitecore Commerce Connect 7.2
Usage Example:
var inventoryService = new InventoryServiceProvider();
GetPreOrderableInformation
Name: GetPreOrderableInformation
Description: Retrieves the pre-orderable information
Usage: Called from Sitecore
Signature: Result [Name](Request request)
Input:
ShopName – String. Mandatory
The name of the shop
Products - List< InventoryProduct >. Mandatory
The list of InventoryProduct
Visitor ID – string. Optional
The ID of the visitor or customer
Output:
OrderableInformation – List<OrderableInformation>
A list of strongly typed objects each with the information for a specific product
SystemMessages - Collection of messages from the external system.
Usage Example:
var inventoryService = new InventoryServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 70 of 142
The Commerce Connect Developer's Guide
GetBackOrderableInformation
Name: [Name]
Description: Gets the back-orderable information
Usage: Called from Sitecore
Signature: Result [Name](Request request)
Input:
ShopName – String. Mandatory
The name of the shop
Products - List< InventoryProduct >. Mandatory
The list of InventoryProduct
Visitor ID – string. Optional
The ID of the visitor or customer
Output:
OrderableInformation – List<OrderableInformation>
A list of strongly typed objects each with the information for a specific product
SystemMessages - Collection of messages from the external system.
Usage Example:
var inventoryService = new InventoryServiceProvider();
VisitedProductStockStatus
Name: VisitedProductStockStatus
Description: Should be called in the event of the customer pays a visit to a product details
page which shows
Usage: Called from Sitecore
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 71 of 142
Sitecore Commerce Connect 7.2
Usage Example:
var inventoryService = new InventoryServiceProvider();
ProductsAreBackInStock
Name: ProductsAreBackInStock
Description: A method that is exposed so that it can be called remotely to signal when
products are back in stock. Executes the corresponding pipeline
ProductsAreBackInStock
Usage: Called from ECS
Signature: ProductsAreBackInStockResult
ProductsAreBackInStock(ProductsAreBackInStockRequest
request)
Input:
Shop Name – string. Mandatory
The name of the shop for which this relates
Products – list< InventoryProduct>. Mandatory
A list of InventoryProduct that signals which products have updated stock
information
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var inventoryService = new InventoryServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 72 of 142
The Commerce Connect Developer's Guide
ProductId = "product_2"
},
new InventoryProduct
{ ProductId = "product_3" }
});
VisitorSignUpForStockNotification
Name: VisitorSignUpForStockNotification
Description: Is used to add visitor to EA plan so they can be notified when the product gets
back in stock
Usage: Called from Sitecore
Signature: VisitorSignUpForStockNotificationResult
VisitorSignUpForStockNotification(VisitorSignUpForStockNotifi
cationRequest request)
Input:
ShopName – string. Mandatory
Visitor ID – string. Mandatory
The ID of the current visitor
Email – string. Mandatory
E-mail address to send the notification to
Product – InventoryProduct. Mandatory
Location – string. Optional
InterestDate – DateTime. Optional
A date and time that signals the deadline for which to notify the visitor
Default is 6 months from now
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var inventoryService = new InventoryServiceProvider();
RemoveVisitorFromStockNotification
Name: RemoveVisitorFromStockNotification
Description: Typically called from Sitecore, when the visitor has decided to unsubscribe from the stock
notification and hence the EA plan
Usage: Called from Sitecore
Signature: RemoveVisitorFromStockNotificationResult
RemoveVisitorFromStockNotification(RemoveVisitorFromStockNotificat
ionRequest request)
Input:
ShopName – string. Mandatory
Visitor ID – string. Mandatory
The ID of the current visitor
Product ID – string. Mandatory
Output:
SystemMessages - Collection of messages from the external system.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 73 of 142
Sitecore Commerce Connect 7.2
Usage Example:
var inventoryService = new InventoryServiceProvider();
GetBackInStockInformation
Name: GetBackInStockInformation
Description: The method is used to get the updated stock information from the ECS
The method is normally called because of method ProductsAreBackInStock has
been called remotely and in that case the pipeline is implicitly called
The difference between GetStockInformation and GetBackInStockInformation is
that the first queries for stock information in a specified location and for a given
customer, where the latter gets the stock information for all locations ignoring
customer context
Usage: Called from Sitecore
Signature: GetBackInStockInformationResult GetBackInStockInformation
(GetBackInStockInformationRequest request)
Input:
Shop Name – string. Mandatory
The name of the shop for which this relates
Products – list< InventoryProduct >. Optional
A list of InventoryProduct to get updated stock information from.
If the list is empty, e.g. no list is provided, it’s up to the ECS to return stock
information updates for the products that have been updated.
Output:
StockInformationUpdates – list<StockInformationUpdate>. Mandatory
A list of StockInformationUpdate object that each signals the product and a list
of locations for which the product is back in stock, when (availability date) and
the count, where the latter two are optional values
SystemMessages - Collection of messages from the external system.
Usage Example:
var inventoryService = new InventoryServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 74 of 142
The Commerce Connect Developer's Guide
GetStockInformation
Name: GetStockInformation
Description: This pipeline is responsible for retrieving stock information for one or more
products specified
StockStatusForIndexing
Developer story:
As a developer I have a StockStatusForIndexing pipeline that runs when the crawler is
indexing products and that returns the information to be indexed
Acceptance criteria
- Check pipeline StockStatusForIndexing has no service layer method associated
- Check pipeline is separate from the pipeline associated with
GetProductStockInformation
- Check the output retrieves in-stock or our-of-stock information associated with each
location
- Check the output includes which location the product is sold
Notes
- User story is 405718
As a developer I get stock status information included in the product index so when I query
the index I can include criteria regarding stock status in connection with location
Acceptance criteria
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 75 of 142
Sitecore Commerce Connect 7.2
o Check that we have a InStock index field that lists all the locations where the
product is in stock
o Check that we have a OutOfStock index field that lists all the locations where
the product is out of stock
o Check that we have a Location index field that contains the locations where
the product is orderable from
o Check that we have a Pre-Orderable index field (Boolean) that indicates
whether the product is pre-orderable or not
Notes
o The index contains only stock status information per product and not per
variant
o The table below shows an example of the product index content for a T-shirt
product that comes in different variants and with the In-Stock and Out-of-
Stock columns
Name: StockStatusForIndexing
Description: Called during indexing to populate the index with stock information
Usage: Called from Sitecore.
Args:
Request – A list of Product IDs is provided from the Sitecore indexing
Response – A list of IndexStockInformation objects is returned for processing
and inclusion into the index
Processors:
StockStatusForIndexing –
Responsibility: To call the ECS and retrieve stock information used to populate
the product index
Usage: Called when crawling product repository and indexing the products.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 76 of 142
The Commerce Connect Developer's Guide
GetPreOrderableInformation
Name: GetPreOrderableInformation
Description: Contacts the ECS to get the pre-orderable information
Usage: Called from Sitecore
Args:
Request – ShopName, list of InventoryProduct, Visitor ID, Location
Response – A list of OrderableInformation
Processors:
GetPreOrderableInformation –
Responsibility: Contacts the ECS to get the pre-orderable information
GetBackOrderableInformation
Name: GetBackOrderableInformation
Description: Contacts the ECS to get the back-orderable information
Usage: Called from Sitecore
Args:
Request – ShopName, list of InventoryProduct, Visitor ID, Location
Response – A list of OrderableInformation
Processors:
GetBackOrderableInformation –
Responsibility: Contacts the ECS to get the back-orderable information
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 77 of 142
Sitecore Commerce Connect 7.2
VisitorAppliedFacet
Name: VisitorAppliedFacet
Description: This pipeline is responsible for triggering page event FacetedBy
Usage: Called from Sitecore and typically doesn’t call the ECS at all
VisitorAppliedSortOrder
Name: VisitorAppliedSortOrder
Description: This pipeline is responsible for triggering page event SortedBy
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 78 of 142
The Commerce Connect Developer's Guide
Usage: Called from Sitecore and typically doesn’t call the ECS at all
ProductsAreBackInStock
Name: ProductsAreBackInStock
Description: Triggers the page event Products Back In Stock, so that the visitors which have
signed up, can be notified
Usage: Called from Sitecore.
Args:
Request – Shop name and a list of InventoryProduct for which the product is
back in stock
Response – None
Processors:
TriggerPageEvent–
Responsibility: Trigger page event Products Back In Stock along with the shop
name and a list of product IDs. Firing the event will trigger the EA plan to re-
evaluate the visitors and determine whether they should be notified
Usage: Called from the ECS to signal when products have come back in stock
GetBackInStockInformation
Name: GetBackInStockInformation
Description: The method and pipeline is used to get the updated stock information from the
ECS
The method is normally called because of method ProductsAreBackInStock has
been called remotely and in that case the pipeline is implicitly called
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 79 of 142
Sitecore Commerce Connect 7.2
Usage: Called from the Sitecore to get the information needed to follow-up in the
EA plan
VisitorSignUpForStockNotification
Name: VisitorSignUpForStockNotification
Description: Called from Sitecore when a visitor wants to be notified when a product gets
back in stock
Usage: Called from Sitecore.
Args:
Request – ShopName, Visitor ID, InventoryProduct and interest Date
Response – None
Processors:
VisitorSignUpForStockNotification –
Responsibility:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 80 of 142
The Commerce Connect Developer's Guide
- Check visitors, who are not already in the EA plan Back In Stock
Notification, are added
- Check Product ID and interest date are stored in the EA state
- Check visitors who are already in the plan stays in the same state,
but has an additional product ID and interest date added to the list
Usage:
TriggerPageEvent
Responsibility:
- Check that page event Back In Stock Subscription is triggered
which includes the product ID, e-mail address and interest date
Usage:
RemoveVisitorFromStockNotification
Name: RemoveVisitorFromStockNotification
Description: Typically called from Sitecore, when the visitor has decided to unsubscribe from
the stock notification and hence the EA plan
Removes the visitor from the EA plan and triggers a page event
Usage: Executed from Sitecore, when the method with the same name is called
Args:
Request – ShopName, VisitorID and ProductID
Response – None
Processors:
RemoveVisitorFromStockNotification –
Responsibility:
- Check visitor ID and product ID are provided
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 81 of 142
Sitecore Commerce Connect 7.2
- Check that the product ID and interest date is removed from the
visitors list and saved to EA state
- Check that if the visitors list of product IDs is empty, then the visitor
is removed from the plan all together
Usage:
TriggerPageEvent –
Responsibility: Check that page event Back In Stock Unsubscription is triggered
which includes the product ID, e-mail address and interest date.
Usage:
OrderedProductStockStatus
Name: OrderedProductStockStatus
Description: Pipeline is called as a part of the SubmitOrder pipeline
Usage: Called implicitly from pipeline AddLinesToCart from the Cart service layer to
trigger a page event whenever a product which is our of stock is added to the
cart
Args:
Request – ShopName and Cart
Response - None, except for external system messages
Processors:
TriggerPageEvent–
Responsibility: For each order line, trigger a page event
ProductsOutOfStockOrdered along with the ShopName, Order ID, Product ID,
Stock Status, if and only if, the stock status is NOT InStock
Usage: Mandatory
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 82 of 142
The Commerce Connect Developer's Guide
AddToCartStockStatus
Name: AddToCartStockStatus
Description: Pipeline is called as a part of the AddLinesToCart pipeline
Usage: Called implicitly from pipeline AddLinesToCart from the Cart service layer to
trigger a page event whenever a product which is our of stock is added to the
cart
Args:
Request – ShopName, Customer ID (visitor ID), Cart ID and Cart-Lines
Response – None, except for external system messages
Processors:
TriggerPageEvent–
Responsibility: Trigger page event AddToCartStockStatus along with the
ShopName, Cart ID, Product ID , Stock Status, Pre-orderable, In-Stock Date,
Shipping Date, if and only if, the stock status is NOT InStock
Usage: Mandatory
VisitedProductStockStatus
Name: VisitedProductStockStatus
Description:
Usage: Called from Sitecore.
Args:
Request – ShopName, Location and an instance of StockInformation
Response – None except system messages
Processors:
TriggerPageEvent–
Responsibility: Trigger page event VisitedProductStockStatus along with
ShopName and the information fund in the StockInformation entity, e.g. Product
ID, Stock Status, AvailabilityDate and count. Note that not all the stock
information fields might have values filled in.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 83 of 142
Sitecore Commerce Connect 7.2
Usage: Mandatory
CurrentProductID
Name: CurrentProductID
Description: The processor is implicitly used by rendering rule conditions that needs to know
the context of which product is the currently selected product
The pipeline is called from Connect.Context when resolving the property
ProductId which returns the current product ID
Usage: Called from Sitecore.
Args:
Request -
Response – The product ID of the current product ID
Processors:
GetCurrentProductID–
Responsibility:
Establish the external ID of the currently selected product.
Depending on the solution, there are different ways to setup the current product
Default implementation will resolve the ID according to how the ECS is setup.
That means the URL indicates the product ID of the current product when
viewing a product details page. On all other pages, the value is undefined
Ownership: ECS
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 84 of 142
The Commerce Connect Developer's Guide
2.5 Customer
Class: CommerceUser
The CommerceUser class is responsible for representing a user account. A user resembles a visitor
of a webshop (website) who has identified him- or herself explicitly by creating a login account by
which the person can be (re-)authorized.
The CommerceUser entity can be extended to include custom information particular to the external
commerce system, but the default implementation will work if users are stored in Sitecore only for
authentication purposes.
The following assertions relates to a user:
A user represents a person who can log in to a website, e.g. hence meaning that an account
exists for that user in the system.
A visitor going through the checkout without registering a user account, e.g. anonymous
checkout, will be created as a customer, but without a user account
Customer and User relationship:
o A user can represent multiple different customers acting as an agent on the
customers behalf
o A customer, i.e. company, can have multiple users representing the company, e.g.
employees of different departments
o Based on the two previous statements it means that there is a many to many
relationship between the two.
Multiple users can manage the same shopping cart on behalf of the same customer or have
individual shopping carts
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 85 of 142
Sitecore Commerce Connect 7.2
Usage scenarios:
When a new account is explicitly created on the site
When an existing user account is used during checkout
When the returning user authenticates him- or herself to get the customer specific product
prices and discounts
When the user and/or customer profile is edited by the user
When the shop owner sends out welcome mail to new users
When the shop owner wants to follow-up on new users that hasn’t returned to the shop for
some time (B2C)
Class: CommerceCustomer
The concept of a customer is determined by the integrated commerce system and the e-shop
solution. In B2C solutions, the customer typically represents a person whereas in B2B scenarios a
customer typically represents a company.
The CommerceCustomer entity will always be extended to include custom information particular to
the external commerce system.
Definition
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 86 of 142
The Commerce Connect Developer's Guide
Usage scenarios:
When a new customer account is created implicitly during anonymous checkout
When the customer profile is edited by the shop owner
When the customer places an order and gets an order confirmation mail
When the shop owner sends out welcome mail to new customers in B2B solutions
When the shop owner wants to make a campaign or promote special offers in B2B solutions
When the shop owner wants to follow-up on new customers that hasn’t placed orders in the
shop for some time
Class: CustomerParty
CustomerParty is used to represent the type and 0-to-many relationship between the customer and a
list of parties
Name Type Description
ExternalID String Unique identifier for the party
PartyId String ID of the party. Reserved for future use in
Sitecore
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 87 of 142
Sitecore Commerce Connect 7.2
Class: CustomerPartyTypes
Class CustomerPartyTypes is used to indicate the type of relationship between the customer and
party.
The class is introduced as an extensible enum. In order to extend and customize the
CustomerPartyTypes options:
public class MyECSCustomerPartyTypes : CustomerPartyTypes
{
public const int MyCustomPartyType = 3;
public MyECSCustomerPartyTypes(int value) : base(value)
{ }
}
Class: Party
The CustomerParty entity represents address contact information and a list of CustomerParty objects
is included in the Customer class
Note: The CustomerParty object is used in both the customer and order service layers.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 88 of 142
The Commerce Connect Developer's Guide
For each method there is a corresponding Request and Result object getting returned, ex.
CreateUser takes a CreateUserRequest object and returns a CreateUserResult object.
The Customer Service Provider contains the following methods for interacting with customer and user
data.
CreateUser
Name: CreateUser
Description: Creates a user account by which the user can re-authenticate him- or herself
upon return.
By default the account is disabled until it has be confirmed by visitor to be a
valid request and ActivateUserAccount has been called
Calls the pipeline "CreateUser".
Usage: Called from Sitecore when a visitor is registering for an account. It could be
during the checkout process or through plain signup.
Signature: CreateUserResult CreateUser(CreateUserRequest request)
Input:
Username – string. Mandatory
The user name for the new user.
Email – string. Mandatory
The e-mail address for the new user.
Password – string. Mandatory
The password for the new user.
Shops– Mandatory
An instance of the CommerceUser object is parsed in. Mandatory fields:
Username, Email, Shops.
Output:
User – An instance of the user object is returned. The user object is updated by
the external commerce system by supplying the External ID value.
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
UpdateUser
Name: UpdateUser
Description: Updates an existing user account. Calls the pipeline "UpdateUser"
Usage: Called from Sitecore when visitor wants to update the information stored on the
account.
Signature: UpdateUserResult UpdateUser(UpdateUserRequest request)
Input:
CommerceUser – An instance of the modified CommerceUser object is passed
in
Output:
User – An instance of the user object is returned.
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 89 of 142
Sitecore Commerce Connect 7.2
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
DeleteUser
Name: DeleteUser
Description: Deletes a user account.
Calls the pipeline "DeleteUser".
Usage: Called from Sitecore when the shop owner wants to delete an account.
It’s a solution business decision whether the account is actually deleted or
simply disabled
Signature: DeleteUserResult DeleteUser(DeleteUserRequest request)
Input:
CommerceUser – An instance of the CommerceUser object is parsed in
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
DisableUser
Name: DisableUser
Description: Disables a user account. Calls the pipeline "DisableUser"
Usage: Called from Sitecore when the user account should be disabled
Signature: DisableUserResult DisableUser(DisableUserRequest request)
Input:
CommerceUser – Mandatory
An instance of the user object is parsed in
Comment – Optional
An optional string that can explain why the user account was disabled. Will be
put in the Page Event as explanation
Output:
CommerceUser – The disabled CommerceUser entity
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 90 of 142
The Commerce Connect Developer's Guide
EnableUser
Name: EnableUser
Description: Enables a user account. Calls the pipeline "EnableUser"
A user account can be disabled for different reasons and triggered by shop
owner, visitor or by system (EA plan).
When a user account is disabled it must be possible to enable it again, which is
the purpose of this method.
The method seems similar to ActivateUserAccount in the way that both enable
the account. The difference lies in the usage scenario and possible actions
associated.
EnableUser is a generic method whereas UserAccountActivation is used in a
specific scenario when a new account is created and must be validated and
then activated. The two trigger different page events, where the event User
Account Activated triggers the EA plan User Account Registration to proceed.
Usage: Called from Sitecore when the user account should be enabled
Signature: EnableUserResult EnableUser(EnableUserRequest request)
Input:
CommerceUser – Mandatory
An instance of the user object is parsed in
Comment – Optional
An optional string that can explain why the user account was enabled. Will be
put in the Page Event as explanation
Output:
CommerceUser – The enabled CommerceUser entity
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
GetUser
Name: GetUser
Description: Returns a single user account. Calls the pipeline "GetUser".
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 91 of 142
Sitecore Commerce Connect 7.2
Usage: Called from Sitecore when searching for one or more accounts
Signature: GetUserResult GetUser(GetUserRequest request)
Input:
ShopName – Mandatory
UserName – Mandatory
The ID of the user to retrieve
Output:
User – A single instance of a User
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
GetUsers
Name: GetUsers
Description: Queries and returns user accounts. Calls the pipeline "GetUsers".
Different input parameters can be provided and they will be combined using
logical and
Usage: Called from Sitecore when searching for one or more accounts
Signature: GetUsersResult GetUsers(GetUsersRequest request)
Input:
ExternalIDs – Optional.
Can be a single or a list of IDs. When provided, it takes precedence
SitecoreIDs – Optional
Can be a single or a list of IDs
UserName – optional
Email – optional
ExternalCustomerIDs – optional
Can be a single or a list of IDs. Used when looking for users associated with a
given customer
Disabled - optional
ShopName – optional
Output:
List<User>
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 92 of 142
The Commerce Connect Developer's Guide
CreateCustomer
Name: CreateCustomer
Description: Creates a customer. Calls the pipeline "CreateCustomer"
Usage: Typically called when a visitor is going through the checkout process
Signature: CreateCustomerResult CreateCustomer(CreateCustomerRequest
request)
Input:
CommerceCustomer – Mandatory
An instance of the CommerceCustomer object is parsed in
Mandatory field values are: Name and Shops
Output:
CommerceCustomer – An instance of the customer object is returned. The
customer object is updated by the external commerce system by supplying the
External ID.
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
IsDisabled = true,
ExternalId = "Jeff",
Users = new[] { "Jeff" }
}));
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Bob",
Shops = new[] { "webstore" },
IsDisabled = false,
ExternalId = "Jeff",
Users = new[] { "Bob" }
}));
UpdateCustomer
Name: UpdateCustomer
Description: Updates an existing customer account. Calls the pipeline "UpdateCustomer"
Usage: Called from Sitecore when visitor or shop owner wants to update the information
stored on the customer account.
Signature: UpdateCustomerResult UpdateCustomer(UpdateCustomerRequest
request)
Input:
CommerceCustomer – An instance of the modified CommerceCustomer object
is parsed in
Output:
CommerceCustomer – An instance of the customer object is returned.
SystemMessages - Collection of messages from the external system.
Usage Example:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 93 of 142
Sitecore Commerce Connect 7.2
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
IsDisabled = true,
ExternalId = "Jeff",
Users = new[] { "Jeff" }
}));
customer.IsDisabled = true;
customer.Name = "Bobby";
DisableCustomer
Name: DisableCustomer
Description: Disables a customer account. Calls the pipeline "DisableCustomer"
Usage: Called from Sitecore when the customer account should be disabled
Signature: DisableCustomerResult
DisableCustomer(DisableCustomerRequest request)
Input:
CommerceCustomer – Mandatory
An instance of the customer object is parsed in
Comment – Optional
An optional string that can explain why the user account was disabled. Will be
put in the Page Event as explanation
Output:
CommerceCustomer – The disabled customer
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 94 of 142
The Commerce Connect Developer's Guide
EnableCustomer
Name: EnableCustomer
Description: Enables a customer account. Calls the pipeline "EnableCustomer"
Usage: Called from Sitecore when the customer account should be enabled
Signature: EnableCustomerResult EnableCustomer(EnableCustomerRequest
request)
Input:
CommerceCustomer – Mandatory
An instance of the customer object is parsed in
Comment – Optional
An optional string that can explain why the user account was enabled. Will be
put in the Page Event as explanation
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
DeleteCustomer
Name: DeleteCustomer
Description: Deletes a customer account.
Calls the pipeline "DeleteUser".
Usage: Called when an account should be deleted
It’s a solution business decision whether the account is actually deleted or
simply disabled
Signature: DeleteCustomerResult DeleteCustomer(DeleteCustomerRequest
request)
Input:
CommerceCustomer – An instance of the CommerceCustomer object is
parsed in
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 95 of 142
Sitecore Commerce Connect 7.2
IsDisabled = false,
ExternalId = "Jeff",
Users = new[] { "Bob" }
})).CommerceCustomer;
GetCustomer
Name: GetCustomer
Description: Returns a single customer instance. Calls the pipeline "GetCustomer".
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Bob",
Shops = new[] { "webstore" },
IsDisabled = false,
ExternalId = "1234567890",
Users = new[] { "Bob" }
}));
GetCustomers
Name: GetCustomers
Description: Queries and returns customer entities. Calls the pipeline "GetCustomers".
Different input parameters can be provided and they will be combined using
logical and
Usage: Called from Sitecore when searching for an account
Signature: GetCustomersResult GetCustomers(GetCustomersRequest
request)
Input:
ExternalIDs – optional
Can be a single or a list of IDs. When provided, it takes precedence
SitecoreIDs – optional
Can be a single or a list of IDs.
Name – optional
ExternalUserIDs – Optional.
Can be a single or a list of IDs. Used when looking for customers associated
with a given user
Disabled – optional
ShopName – optional
Output:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 96 of 142
The Commerce Connect Developer's Guide
List<CommerceCustomer>
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
IsDisabled = true,
ExternalId = "Jeff",
Users = new[] { "Jeff" }
}));
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Bob",
Shops = new[] { "webstore" },
IsDisabled = false,
ExternalId = "Jeff",
Users = new[] { "Bob" }
}));
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Michael",
Shops = new[] { "autohaus" },
IsDisabled = false,
ExternalId = "Michael",
Users = new[] { "Michael" }
}));
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Kerry",
Shops = new[] { "webstore" },
IsDisabled = true,
ExternalId = "Michael",
Users = new[] { "Michael" }
}));
AddCustomers
Name: AddCustomers
Description: Add a customer to a user. Calls the pipeline "AddCustomers"
Usage: Called to associated a visitor to a user
Signature: AddCustomersResult AddCustomers(AddCustomersRequest
request)
Input:
List<string> CustomerIds – the customer ids to add to the user
Output:
IReadOnlyCollection<string> CustomerIds – the list of customer ids
associated with the user
SystemMessages - Collection of messages from the external system.
Usage Example:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 97 of 142
Sitecore Commerce Connect 7.2
// create a customer
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
}));
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
AddUsers
Name: AddUsers
Description: Add a user to a customer. Calls the pipeline "AddUsers"
Usage: Called to associated a user to a visitor
Signature: AddUsersResult AddUsers(AddUsersRequest request)
Input:
List<string> UserIds – the user ids to add to the customer
Output:
IReadOnlyCollection<string> UserIds – the list of user ids associated with the
customer
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
})).CommerceCustomer;
RemoveCustomers
Name: RemoveCustomers
Description: Removes customers from a user. Calls the pipeline "RemoveCustomers"
Usage: Called to remove an associated visitor to a user
Signature: RemoveCustomersResult
RemoveCustomers(RemoveCustomersRequest request)
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 98 of 142
The Commerce Connect Developer's Guide
Input:
List<string> CustomerIds – the customer ids to remove from the user
Output:
IReadOnlyCollection<string> CustomerIds – the list of customer ids
associated with the user
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create 2 customers
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "webstore" },
ExternalId = "1234567890"
}));
customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Bob",
Shops = new[] { "webstore" },
ExternalId = "9876543210"
}));
// create a user
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
// remove a customer
var removeRequest = new RemoveCustomersRequest(user, new List<string> { "1234567890"
});
var removeResult = customerService.RemoveCustomers(removeRequest);
RemoveUsers
Name: RemoveUsers
Description: Removes users from a customer. Calls the pipeline "RemoveUsers"
Usage: Called to remove an associated user to a visitor
Signature: RemoveUsersResult RemoveUsers(RemoveUsersRequest request)
Input:
List<string> UserIds – the user ids to remove from the customer
Output:
IReadOnlyCollection<string> UserIds – the list of user ids associated with the
customer
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create 2 users
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
var user = customerService.CreateUser(request).CommerceUser;
request = new CreateUserRequest("JaneSmith", "passWord", "[email protected]", "webstore");
var user2 = customerService.CreateUser(request).CommerceUser;
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 99 of 142
Sitecore Commerce Connect 7.2
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
})).CommerceCustomer;
// remove a user
var removeRequest = new RemoveUsersRequest(customer, new List<string> {
user.ExternalId });
var removeResult = customerService.RemoveUsers(removeRequest);
AddCustomerParties
Name: AddCustomerParties
Description: This method is responsible for adding one or more given customer parties to the
specified customer
Usage: Called from Sitecore when adding parties to a customer account, typically during
checkout or editing the customer account
Signature: AddCustomerPartiesResult AddCustomerParties
(AddCustomerPartiesRequest request)
Input:
Customer – CommerceCustomer. Mandatory
An instance of the customer
CustomerParties – List<CustomerParty>. Mandatory
A list of customer parties to associate with the customer
Output:
Customer - Customer. Mandatory
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
})).CommerceCustomer;
RemoveCustomerParties
Name: RemoveCustomerParties
Description: This method is responsible for removing one or more given customer parties
from the specified customer
Usage: Called from Sitecore when removing parties to a customer account, typically
when editing the customer account
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 100 of 142
The Commerce Connect Developer's Guide
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
})).CommerceCustomer;
UpdateCustomerParties
Name: UpdateCustomerParties
Description: This method is responsible for updating one or more given customer parties on
the specified customer
Usage: Called from Sitecore when updating parties on a customer account, typically
when editing the customer account
Signature: UpdateCustomerPartiesResult UpdateCustomerParties
(UpdateCustomerPartiesRequest request)
Input:
Customer – CommerceCustomer. Mandatory
An instance of the customer
Parties – List<Party>. Mandatory
A list of customer parities to update on the customer
Output:
Customer - Customer. Mandatory
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 101 of 142
Sitecore Commerce Connect 7.2
ExternalId = "1234567890"
})).CommerceCustomer;
AddParties
Name: AddParties
Description: This method is responsible for adding one or more given customer parties to the
specified customer
Usage: Called from Sitecore when adding parties to a customer account, typically during
checkout or editing the customer account
Signature: AddPartiesResult AddParties(AddPartiesRequest request)
Input:
Customer – CommerceCustomer. Mandatory
An instance of the customer
Parties – List<Party>. Mandatory
A list of customer parties to add
Output:
Customer - Customer. Mandatory
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
})).CommerceCustomer;
GetParties
Name: GetParties
Description: This method is responsible for getting all the parties
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 102 of 142
The Commerce Connect Developer's Guide
Usage: Called from Sitecore when adding parties to a customer account, typically during
checkout or editing the customer account
Signature: AddPartiesResult AddParties(AddPartiesRequest request)
Input:
Customer – CommerceCustomer. Mandatory
An instance of the customer
Output:
Parties – List<Party>
A list of parties
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
})).CommerceCustomer;
RemoveParties
Name: RemoveParties
Description: This method is responsible for removing one or more given customer parties
from the specified customer
Usage: Called from Sitecore when removing parties to a customer account, typically
when editing the customer account
Signature: RemovePartiesResult RemoveParties(RemovePartiesRequest
request)
Input:
Customer – CommerceCustomer. Mandatory
An instance of the customer
Parties – List<Party>. Mandatory
A list of customer parties to remove
Output:
Customer - Customer. Mandatory
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 103 of 142
Sitecore Commerce Connect 7.2
ExternalId = "1234567890"
})).CommerceCustomer;
UpdateParties
Name: UpdateParties
Description: This method is responsible for updating one or more given customer parties on
the specified customer
Usage: Called from Sitecore when updating parties on a customer account, typically
when editing the customer account
Signature: UpdatePartiesResult UpdateParties(UpdatePartiesRequest
request)
Input:
Customer – CommerceCustomer. Mandatory
An instance of the customer
Parties – List<Party>. Mandatory
A list of parties to update
Output:
Customer - Customer. Mandatory
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a customer
var customer = customerService.CreateCustomer(new CreateCustomerRequest(
new CommerceCustomer
{
Name = "Jeff",
Shops = new[] { "autohaus" },
ExternalId = "1234567890"
})).CommerceCustomer;
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 104 of 142
The Commerce Connect Developer's Guide
UpdatePassword
Name: UpdatePassword
Description: Change the user password. Calls the pipeline "UpdatePassword"
Usage: Called from Sitecore when password needs to be changed.
Signature: UpdatePasswordResult UpdatePassword(UpdatePasswordRequest
request)
Input:
UserID – Mandatory The ID of the user to change the password for
OldPassword – Mandatory.
The old password
NewPassword – Mandatory
The new password
Output:
SystemMessages - Collection of messages from the external system.
Usage Example:
var customerService = new CustomerServiceProvider();
// create a customer
var request = new CreateUserRequest("JohnSmith", "password", "[email protected]",
"webstore");
customerService.CreateUser(request);
CreateUser
Depending on the actual integration with ECS and the solution then the user can be disabled by
default and will get activated when ActivateUserAccount is called
Name: CreateUser
Description: This pipeline is responsible for creating a user account
Note: If External ID is parsed in and the user already exists, nothing should
happen
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 105 of 142
Sitecore Commerce Connect 7.2
CreateUserInCMS – (Mandatory)
Creates the user but more importantly stores the relation to
CommerceCustomer in Sitecore, using the membership and profile providers.
If user already exists, then the pipeline should be aborted to avoid triggering the
goal.
Note: This processor is mandatory to store the 1-to-many relationship between
the CommerceUser and CommerceCustomer. If that is handled in the ECS, the
processor is not mandatory
TriggerDMSGoal –
The goal “User Account Created” is triggered with values User name and
ShopName.
AddVisitorToEAPlan –
Adds visitor to EA plan, i.e. “User Account Registered”, which sends an account
activation mail and later a welcome mail when the account has been activated
UpdateUser
Name: UpdateUser
Description: This pipeline is responsible for updating an existing user account.
Usage: Called from Sitecore.
Args:
Request - Contains the user entity. Is set prior to calling the pipeline.
Response - Contains the user entity. Is read after the pipeline is called.
Processors:
UpdateUserInECS – Optional
Updates an existing user account in the external commerce system.
UpdateUserInCMS – Mandatory
Updates the user account in the Sitecore. Since the user is updated externally
first, then the user data can be changed there and the final version is stored in
CMS.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 106 of 142
The Commerce Connect Developer's Guide
DeleteUser
Name: DeleteUser
Description: This pipeline is responsible for deleting an existing user account.
Usage: Called from Sitecore.
Args:
Request - Contains the user entity. Is set prior to calling the pipeline.
Response -
Processors:
DeleteUserInECS – Optional
Deletes an existing user in the external commerce system.
Note: If user account doesn’t exists it can be noted in returned collection of
External System Messages, but the pipeline must continue
Note: This processor is optional but recommended if CommerceUsers are
supported in the ECS.
DeleteUserInCMS – Mandatory
Deletes the user in the Sitecore.
Note: If user account doesn’t exist, the pipeline is aborted
Note: This processor is mandatory to store the 1-to-many relationship between
the CommerceUser and CommerceCustomer. If that is handled in the ECS, the
processor is not mandatory
DisableUser
Name: DisableUser
Description: This pipeline is responsible for disabling an existing user account.
Usage: Called from Sitecore.
Args:
Request - Contains the user entity and a comment. Is set prior to calling the
pipeline.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 107 of 142
Sitecore Commerce Connect 7.2
DisableUserInCMS – Mandatory
Disables the user in Sitecore.
Note: Since the user is attempted disabled externally first, then it’s possible that
the pipeline is aborted due to business rules and the users are still synchronized
Note: This processor is mandatory to store the 1-to-many relationship between
the CommerceUser and CommerceCustomer. If that is handled in the ECS, the
processor is not mandatory
EnableUser
Name: EnableUser
Description: This pipeline is responsible for enabling an existing user account.
Usage: Called from Sitecore.
Args:
Request - Contains the user entity and a comment. Is set prior to calling the
pipeline.
Response - Is read after the pipeline is called.
Processors:
EnableUserInECS – Optional
Enables an existing user in the external commerce system.
Note: Either this processor or the next should be in the pipeline, normally not
both
EnableUserInCMS – Mandatory
Enables the user in Sitecore.
Note: Since the user is attempted enabled externally first, then it’s possible that
the pipeline is aborted due to business rules and the users are still synchronized
Note: This processor is mandatory to store the 1-to-many relationship between
the CommerceUser and CommerceCustomer. If that is handled in the ECS, the
processor is not mandatory
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 108 of 142
The Commerce Connect Developer's Guide
GetUsers
Name: GetUsers
Description: Queries and returns user accounts.
Different input parameters can be provided and they will be combined using
logical and
Usage: Called from Sitecore when a visitor is registering for an account. It could be
during the checkout process or through plain signup.
Args:
Request - Contains search parameters. Is set prior to calling the pipeline.
Response – Returns a list of user entities. Is read after the pipeline is called.
Processors:
GetUsersFromECS – Optional
Queries against users in the external commerce system.
Note: Either this processor or the next should be in the pipeline, normally not
both
Note: This processor is optional but recommended if CommerceUsers are
supported in the ECS.
GetUsersFromCMS – Mandatory
Queries against users in CMS.
Note: Either this processor or the next should be in the pipeline, normally not
both
GetUser
Name: GetUser
Description: Returns a single user account.
Usage: Called from Sitecore when a visitor a specific user account is needed
Args:
Request - Contains ShopName and User ID. Is set prior to calling the pipeline.
Response – Returns a single user entity. Is read after the pipeline is called.
Processors:
GetUserFromECS – Optional
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 109 of 142
Sitecore Commerce Connect 7.2
CreateCustomer
Name: CreateCustomer
Description: This pipeline is responsible for creating a customer account. The customers are
managed by the commerce system.
Usage: Called from Sitecore
Args:
Request - Contains the customer entity. Is set prior to calling the pipeline.
Response - Contains the customer entity after the pipeline is called.
Processors:
CreateCustomerInECS – Optional
Depends on whether Customers are supported in the ECS
Creates customer in external commerce system.
It involves:
o Create unique customer account in external system
o Create mapping between Customer and any given user
accounts
Note: If External ID is parsed in and the customer already exists, nothing should
happen
CreateCustomerInSitecore – (Mandatory)
Creates customer in Sitecore
Note: This processor is mandatory to store the 1-to-many relationship between
the CommerceUser and CommerceCustomers. If that is handled in the ECS, the
processor is not mandatory
AddCustomerToEAplan–
Adds the customer to EA plan Customers storing a reference to the
CommerceCustomer in EA state
Since the customer potentially is created externally first, then the external ID of
the customer is given and can be stored in Sitecore too, making the connection
between the two.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 110 of 142
The Commerce Connect Developer's Guide
Note: If External ID is parsed in and the customer already exists, then the
pipeline should be aborted to avoid triggering the goal.
TriggerDMSGoal – the goal “Customer Account Created” is triggered with
values customer name and ShopName
GetCustomers
Name: GetCustomers
Description: Queries and returns customer accounts.
Different input parameters can be provided and they will be combined using
logical and
Whether the customers are retrieved from ECS or CMS depends on the support
of customers in ECS
Usage: Called from Sitecore
Args:
Request - Contains search parameters.. Is set prior to calling the pipeline.
Response - Returns a list of customer entities after the pipeline is called.
Processors:
GetCustomersFromECS – optional
Queries against customers in the external commerce system. If the required
search functionality is not supported in the ECS, then it can potentially be
handled by searching for customers in CMS.
Note: Either this processor or the next should be in the pipeline, normally not
both
GetCustomersFromCMS – optional
Queries against Customers in CMS. If the required search functionality is not
supported in CMS, then it can potentially be handled by searching for users in
the ECS
Note: Either this processor or the previous should be in the pipeline, normally
not both
GetCustomer
Name: GetCustomer
Description: Returns the single customer entity with the specified ID
Whether the customer is retrieved from ECS or CMS depends on the support of
customers in ECS
Usage: Called from Sitecore
Args:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 111 of 142
Sitecore Commerce Connect 7.2
Request - Contains shop name and Customer ID. Is set prior to calling the
pipeline.
Response - Returns a single customer entity after the pipeline is called.
Processors:
GetCustomerFromECS – optional
Gets the specified customer from the external commerce system.
Note: Either this processor or the next should be in the pipeline, normally not
both
GetCustomersFromCMS – Mandatory
Gets the specified customer from CMS.
Note: Either this processor or the previous should be in the pipeline, normally
not both
UpdateCustomer
Name: UpdateCustomer
Description: This pipeline is responsible for updating an existing customer account. The
customers are managed by the commerce system.
Usage: Called from Sitecore
Args:
Request - Contains the customer entity. Is set prior to calling the pipeline.
Response - Contains the customer object. Is read after the pipeline is called.
Processors:
UpdateCustomerInECS – Mandatory
Updates customer in external commerce system.
SaveCustomertoEAState – mandatory
Updates the customer stored in EA state based on updated
CommerceCustomer returned from previous processor
TriggerDMSEvent – the goal “Customer Account Updated” is triggered with
values customer name and ShopName
DeleteCustomer
Name: DeleteCustomer
Description: This pipeline is responsible for deleting an existing customer account. The
customers are managed by the commerce system.
Usage: Called from Sitecore
Args:
Request - Contains the customer entity. Is set prior to calling the pipeline.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 112 of 142
The Commerce Connect Developer's Guide
Response -
Processors:
DeleteCustomerInECS – Mandatory
Deletes customer in external system.
Note: If customer account doesn’t exists it can be noted in returned collection of
External System Messages, but the pipeline must continue
RemoveCustomerFromEAState – Mandatory
Removes the customer stored in EA state
TriggerDMSEvent – the goal “Customer Account Deleted” is triggered with
values customer name and ShopName
DisableCustomer
Name: DisableCustomer
Description: This pipeline is responsible for disabling an existing customer account.
Usage: Called from Sitecore.
Args:
Request - Contains the customer entity and a comment. Is set prior to calling
the pipeline.
Response – The disabled customer entity. Is read after the pipeline is called.
Processors:
DisableCustomerInECS –
Disables an existing customer in the external commerce system.
SaveCustomertoEAState – mandatory
Updates the customer stored in EA state based on updated
CommerceCustomer returned from previous processor
TriggerDMSEvent – the page event “Customer Account Disabled” is triggered
with values Name, ShopName and the provided comment.
EnableCustomer
Name: EnableCustomer
Description: This pipeline is responsible for enabling an existing customer account.
Usage: Called from Sitecore.
Args:
Request - Contains the customer entity and a comment. Is set prior to calling
the pipeline.
Response – The enabled customer entity. Is read after the pipeline is called.
Processors:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 113 of 142
Sitecore Commerce Connect 7.2
EnableCustomerInECS –
Enables an existing customer in the external commerce system.
SaveCustomertoEAState – mandatory
Updates the customer stored in EA state based on updated
CommerceCustomer returned from previous processor
TriggerDMSEvent –
the pageevent “Customer Account Enabled” is triggered with values Name,
ShopName and the provided comment.
AddCustomerParties
Name: AddCustomerParties
Description: This pipeline is responsible for adding customer parties to the specified
customer
Usage: Called from Sitecore.
Args:
Request - Contains a customer and a list of CustomerParty instances. Is set
prior to calling the pipeline.
Response – A new instance of the customer Is read after the pipeline is called.
Processors:
AddCustomerParties –
Responsibility: Is to add the provided parties to the customer account and
persist them
Usage: Mandatory.
Ownership: The processor is provided with Connect and stores the parties with
the customer account using the Sitecore membership provider
RemoveCustomerParties
Name: RemoveCustomerParties
Description: This pipeline is responsible for removing customer parties from the specified
customer
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 114 of 142
The Commerce Connect Developer's Guide
Usage: Mandatory.
Ownership: The processor is provided with Connect and removes the parties
which will no longer be persisted anywhere in Sitecore
UpdateCustomerParties
Name: UpdateCustomerParties
Description: This pipeline is responsible for updating customer parties on the specified
customer
Usage: Called from Sitecore.
Args:
Request - Contains a customer and a list of CustomerParty instances. Is set
prior to calling the pipeline.
Response – A new instance of the customer Is read after the pipeline is called.
Processors:
UpdateCustomerParties –
Responsibility: Is to update the provided parties on the customer account and
persist them
Usage: Mandatory.
Ownership: The processor is provided with Connect and stores the updated
parties with the customer account using the Sitecore membership provider
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 115 of 142
Sitecore Commerce Connect 7.2
GetParties
Name: GetParties
Description: This pipeline is responsible for getting the parties
Usage: Called from Sitecore.
Args:
Request - Contains a customer. Is set prior to calling the pipeline.
Response – A list of parties. Is read after the pipeline is called.
Processors:
GetParties –
Responsibility: Is to return the complete list of parties stored with the customer
Usage: Mandatory.
Ownership: The processor is provided with Connect and stores the parties with
the customer account using the Sitecore membership provider
AddParties
Name: AddParties
Description: This pipeline is responsible for adding parties to the specified customer
Usage: Called from Sitecore.
Args:
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 116 of 142
The Commerce Connect Developer's Guide
Usage: Mandatory.
Ownership: The processor is provided with Connect and stores the parties with
the customer account using the Sitecore membership provider
RemoveParties
Name: RemoveParties
Description: This pipeline is responsible for removing parties stored with the specified
customer
Usage: Called from Sitecore.
Args:
Request - Contains a customer and a list of party instances. Is set prior to
calling the pipeline.
Response – A new instance of the customer Is read after the pipeline is called.
Processors:
RemoveParties –
Responsibility: Is to remove the provided parties from the customer account
Usage: Mandatory.
Ownership: The processor is provided with Connect and removes the parties
which will no longer be persisted anywhere in Sitecore
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 117 of 142
Sitecore Commerce Connect 7.2
There should be a separate processor for storing the parties in the ECS. The
processor should either replace this processor or be added in addition to this
processor
UpdateParties
Name: UpdateParties
Description: This pipeline is responsible for updating customer parties on the specified
customer
Usage: Called from Sitecore.
Args:
Request - Contains a customer and a list of CustomerParty instances. Is set
prior to calling the pipeline.
Response – A new instance of the customer Is read after the pipeline is called.
Processors:
UpdateParties –
Responsibility: Is to update the provided parties on the customer account and
persist them
Usage: Mandatory.
Ownership: The processor is provided with Connect and stores the updated
parties with the customer account using the Sitecore membership provider
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 118 of 142
The Commerce Connect Developer's Guide
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 119 of 142
Sitecore Commerce Connect 7.2
Note: The domain model consists of abstract classes that make up the contracts with the external
system. The contracts are defined as abstract classes instead of interfaces to allow the model to be
easily extended later if needed. This follow the best practice guidelines defined in the book
Framework Design Guidelines.
Default implementation of the contracts are delivered as part of Connect. If an actual Connect
provider with an external commerce system contains more functionality that provided by default, the
implementation can be replaced. All instantiation of actual classes will be handled through
dependency injection.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 120 of 142
The Commerce Connect Developer's Guide
Class: Product
The product class is responsible for representing a product or any variant of it, hence a variant is a
product in this model.
Class: ProductSpecifications
Name Type Description
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 121 of 142
Sitecore Commerce Connect 7.2
Class: ProductSpecification
Name Type Description
ExternalId string Unique identifier for the user in the
commerce system. This can be
used to get a reference to the user
using the commerce system's
native API.
Will be empty until account has
been created in external system
SitecoreItemId string Represents the Sitecore Id.
Group String
Key String
Value String
Created DateTime
Updated DateTime
Class: ProductClassification
Name Type Description
ExternalId string Unique identifier for the user in
the commerce system. This can
be used to get a reference to the
user using the commerce
system's native API.
Will be empty until account has
been created in external system
ExternalParentId string
SitecoreItemId string Represents the Sitecore Id.
Name string
Description string
Specifications ProductSpecifications
Created DateTime
Updated
Class: ProductType
Name Type Description
ExternalId string Unique identifier for the user in
the commerce system. This can
be used to get a reference to the
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 122 of 142
The Commerce Connect Developer's Guide
Class: ProductManufacturer
Name Type Description
ExternalId string Unique identifier for the user in
the commerce system. This can
be used to get a reference to the
user using the commerce
system's native API.
Will be empty until account has
been created in external system
SitecoreItemId string Represents the Sitecore Id.
Name String
Description String
WebSiteUrl String
ProductTypes IReadOnlyCollection<ProductType>
Created DateTime
Updated DateTime
Class: ProductClassificationGroup
Name Type Description
ExternalId string Unique identifier for the user in
the commerce system. This
can be used to get a reference
to the user using the
commerce system's native API.
Will be empty until account has
been created in external
system
SitecoreItemId string Represents the Sitecore Id.
Name String
Description String
Classifications IReadOnlyCollection<ProductClassification>
Created DateTime
Updated Name
Class: ProductVariantSpecificaions
Name Type Description
ExternalId string Unique identifier for the user in
the commerce system. This can
be used to get a reference to
the user using the commerce
system's native API.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 123 of 142
Sitecore Commerce Connect 7.2
Class: ProductResource
Name Type Description
ExternalId string Unique identifier for the user in the
commerce system. This can be
used to get a reference to the user
using the commerce system's
native API.
Will be empty until account has
been created in external system
SitecoreItemId string Represents the Sitecore Id.
Created DateTime
Updated DateTime
Class: Division
Name Type Description
ExternalId string Unique identifier for the user in
the commerce system. This can
be used to get a reference to the
user using the commerce
system's native API.
Will be empty until account has
been created in external system
SitecoreItemId string Represents the Sitecore Id.
Name String
SubDivisions IReadOnlyCollection<Division>
Created DateTime
Updated DateTime
Class: ProductRelation
Name Type Description
ExternalId string Unique identifier for the user in the
commerce system. This can be
used to get a reference to the user
using the commerce system's
native API.
Will be empty until account has
been created in external system
SitecoreItemId string Represents the Sitecore Id.
Product Product
ReferredProduct Product
Created DateTime
Updated DateTime
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 124 of 142
The Commerce Connect Developer's Guide
Class: ProductRelationType
Name Type Description
ExternalId string Unique identifier for the user in
the commerce system. This can
be used to get a reference to the
user using the commerce
system's native API.
Will be empty until account has
been created in external system
SitecoreItemId string Represents the Sitecore Id.
Name String
Relations IReadOnlyCollection<ProductRelation>
Created DateTime
Updated DateTime
SynchronizeProducts
SyncronizeProducts is used to synchronize a collection of products between the external commerce
system and Sitecore.
The synchronization can go both ways, so changes made to product data in CMS content are pushed
to the external commerce system.
A log must be kept of events registered during synchronization. At minimum it should contain a list of
products successfully updated. It would be better
Upon return the result contains the list of messages generated during synchronization, which would
be the Ids of the products that failed during synchronization
Name: SynchronizeProducts
Description: SynchronizeProducts calls the pipeline " SynchronizeProducts" to synchronize
changes to all updated products and related repositories
Usage: Called from Sitecore or the ECS when the product manager wants to update
products both from and to the ECS
Signature: SynchronizeProductsResult
SynchronizeProducts(SynchronizeProductsRequest request)
Input:
Language – string, optional.
The language for the product data being synchronized. Default is English (“en”
or “US-EN”)
Direction – optional. An enum type indicating whether synchronization goes
from ECS -> SC, SC -> ECS or both ways. The default is ECS -> SC. See
section Error! Reference source not found. for more.
Output:
SystemMessages - Collection of messages from the external system.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 125 of 142
Sitecore Commerce Connect 7.2
SynchronizeProductList
Name: SynchronizeProductList
Description: SynchronizeProductList calls the pipeline " SynchronizeProductList"
Usage: Called from Sitecore or the ECS when the product manager wants to update a
list of products both from and to the ECS
Signature: SynchronizeProductListResult
SynchronizeProductList(SynchronizeProductListRequest
request)
Input:
List<ExternalProductIds> - List of strings, mandatory
The list of external product ids to synchronize
Language – string, optional.
The language for the product data being synchronized. Default is English (“en” or
“US-EN”)
Direction – enum, optional
An enum type indicating whether synchronization goes from ECS -> SC, SC ->
ECS or both ways. The default is ECS -> SC. See section Error! Reference
ource not found. for more.
Output:
SystemMessages - Collection of messages from the external system.
SynchronizeProduct
SyncProduct is used to synchronize a single product between the external commerce system and
Sitecore. The product to synchronize is given by ID.
The synchronization can go both ways, so changes made to product data in CMS content are pushed
to the external commerce system as well.
Name: SynchronizeProduct
Description: SynchronizeProduct calls the pipeline " SynchronizeProduct"
Usage: Called from Sitecore or the ECS when the product manager wants to update a
single product both from and to the ECS
Signature: SynchronizeProductResult
SynchronizeProduct(SynchronizeProductRequest request)
Input:
ProductId – string, mandatory
The external product id to be synchronized
Language – string, optional.
The language for the product data being synchronized. Default is English (“en”
or “US-EN”)
Direction – enum, optional
An enum type indicating whether synchronization goes from ECS -> SC, SC ->
ECS or both ways. The default is ECS -> SC. See section Error! Reference
ource not found. for more.
Output:
SystemMessages - Collection of messages from the external system.
SynchronizeArtifacts
SynchronizeArtifacts is responsible for synchronizing all the related repositories: Manufacturers,
Types, Classifications, Divisions, Resources, and Specifications before the individual products are
synchronized the references to repositories are updated.
Name: SynchronizeArtifacts
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 126 of 142
The Commerce Connect Developer's Guide
Output:
SystemMessages - Collection of messages from the external system.
SynchronizeProducts
SyncronizeProducts is used to synchronize products between the external commerce system and
Sitecore.
Name:
SynchronizeProducts
Description: This pipeline is responsible for obtaining the lists of product Ids to be
synchronized and iterate over them
Usage: Called from Sitecore or the external commerce system
Args:
Request – Is empty by default. Is set prior to calling the pipeline.
Response - Contains the list of messages generated during synchronization,
which would be the Ids of the products that failed during synchronization Is read
after the pipeline is called.
Processors:
RunSynchronizeArtifacts – Calls individual pipeline to synchronize all the
related repositories: Manufacturers, Types, Classifications, Divisions,
Resources, Specifications
RunGetSCProductList – Obtain the list of product ids to synchronize from
Sitecore. This processor can be left out if product data is only pushed from the
external system
RunGetECSProductList - Obtain the list of product ids to synchronize from
ECS
EvaluateProductListUnionToSynchronize – Creates the union of product Ids
to be synchronized based on the two lists obtained from ECS and SC
RunSynchronizeProductList – Calls individual pipeline with the evaluated list
of product IDs to synchronize
SynchronizeProductList
SyncronizeProductlist is used to synchronize a given list of products between the external commerce
system and Sitecore.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 127 of 142
Sitecore Commerce Connect 7.2
Name:
SynchronizeProductList
Description: This pipeline is responsible for iterating over the given list of product Ids and
synchronize
Usage: Called from Sitecore or the external commerce system
Args:
Request – List of product Ids to synchronize. Is set prior to calling the pipeline.
Response - Contains the list of messages generated during synchronization,
which would be the Ids of the products that failed during synchronization Is read
after the pipeline is called.
Processors:
SynchronizeProductList - Iterates over the given list of product Ids and runs
pipeline SynchronizeProduct for each product
GetExternalCommerceSystemProductList
Name:
GetExternalCommerceSystemProductList
Description: This pipeline is responsible for obtaining the list of product Ids to be
synchronized from the external commerce system
Usage: Called internally from SynchronizeProducts but can also be called explicitly from
both ECS or SC
Args:
Request – No default data. Is set prior to calling the pipeline.
Response - Contains the list of product Ids to be synchronized and
SystemMessages. Is read after the pipeline is called.
Processors:
GetExternalCommerceSystemProductList – Get list of IDs from ECS
GetSitecoreProductList
Name:
GetSitecoreProductList
Description: This pipeline is responsible for obtaining the list of product Ids to be
synchronized from Sitecore
Usage: Called internally from SynchronizeProducts but can also be called explicitly from
both ECS or SC
Args:
Request – No default data. Is set prior to calling the pipeline.
Response - Contains the list of product Ids to be synchronized and
SystemMessages. Is read after the pipeline is called.
Processors:
GetSitecoreProductList – Get list of IDs from Sitecore
SynchronizeArtifacts
Name:
SynchronizeArtifacts
Description: This pipeline is responsible for synchronizing all the related repositories:
Manufacturers, Types, Classifications, Divisions, Resources, Specifications
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 128 of 142
The Commerce Connect Developer's Guide
SynchronizeManufacturers
Name:
SynchronizeManufacturers
Description: This pipeline is responsible for synchronizing all manufacturers in the separate
Manufactures repository
Usage: Called from pipeline SynchronizeArtifacts as initialization of separate
repositories before synchronizing products and their references to these
repositories.
Args:
Request – Is empty by default. Is set prior to calling the pipeline.
Response - Contains the list of messages generated during synchronization
Processors:
ReadManufacturersFromSC – Optional
Reads the manufacturers to synchronize from SC. This processor can be
skipped if changes only are pushed from ECS to SC.
ReadManufacturersFromECS – Mandatory
Reads the manufacturers to synchronize from ECS
ResolveManufacturersChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveManufacturersToECS – Optional
Saves synchronized manufacturers to ECS. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveManufacturersToSC – Mandatory
Saves synchronized manufacturers to SC.
SynchronizeClassifications
Name:
SynchronizeClassifications
Description: This pipeline is responsible for synchronizing all classifications in the separate
Classifications repository
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 129 of 142
Sitecore Commerce Connect 7.2
SynchronizeTypes
Name:
SynchronizeTypes
Description: This pipeline is responsible for synchronizing all Types in the separate Product
Types repository
Usage: Called from pipeline SynchronizeArtifacts as initialization of separate
repositories before synchronizing products and their references to these
repositories.
Args:
Request – Is empty by default. Is set prior to calling the pipeline.
Response - Contains the list of messages generated during synchronization
Processors:
ReadTypesFromSC – Optional
Reads the types to synchronize from SC. This processor can be skipped if
changes only are pushed from ECS to SC.
ReadTypesFromECS – Mandatory
Reads the types to synchronize from ECS
ResolveTypesChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveTypesToECS – Optional
Saves synchronized types to ECS. This processor can be skipped if changes
only are pushed from ECS to SC.
SaveTypesToSC – Mandatory
Saves synchronized types to SC.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 130 of 142
The Commerce Connect Developer's Guide
SynchronizeDivisions
Name:
SynchronizeDivisions
Description: This pipeline is responsible for synchronizing all divisions in the separate
Divisions repository
Usage: Called from pipeline SynchronizeArtifacts as initialization of separate
repositories before synchronizing products and their references to these
repositories.
Args:
Request – Is empty by default. Is set prior to calling the pipeline.
Response - Contains the list of messages generated during synchronization
Processors:
ReadDivisionsFromSC – Optional
Reads the divisions to synchronize from SC. This processor can be skipped if
changes only are pushed from ECS to SC.
ReadDivisionsFromECS – Mandatory
Reads the divisions to synchronize from ECS
ResolveDivisionsChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveDivisionsToECS – Optional
Saves synchronized divisions to ECS. This processor can be skipped if changes
only are pushed from ECS to SC.
SaveDivisionsToSC – Mandatory
Saves synchronized divisions to SC.
SynchronizeResources
Name:
SynchronizeResources
Description: This pipeline is responsible for synchronizing all resources in Sitecore Media
Library
Usage: Called from pipeline SynchronizeArtifacts as initialization of separate
repositories before synchronizing products and their references to these
repositories.
NB In case resources are kept only in the ECS, then this pipeline can be
skipped or configured empty
Args:
Request – Is empty by default. Is set prior to calling the pipeline.
Response - Contains the list of messages generated during synchronization
Processors:
ReadResourcesFromSC – Optional
Reads the resources to synchronize from SC. This processor can be skipped if
changes only are pushed from ECS to SC.
ReadResourcesFromECS – Mandatory
Reads the resources to synchronize from ECS
ResolveResourcesChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveResourcesToECS – Optional
Saves synchronized resources to ECS. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveResourcesToSC – Mandatory
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 131 of 142
Sitecore Commerce Connect 7.2
SynchronizeSpecifications
Name:
SynchronizeSpecifications
Description: This pipeline is responsible for synchronizing specifications on type, category
and globally by running separate pipelines for each
Usage: Called from pipeline SynchronizeArtifacts as initialization of separate
repositories before synchronizing products and their references to these
repositories
Args:
Request - Is set prior to calling the pipeline.
Response - Is read after the pipeline is called.
Processors:
RunSynchronizeGlobalSpecifications – Runs a separate pipeline to
synchronize global specifications
RunSynchronizeTypeSpecifications - Runs a separate pipeline to
synchronize type specifications
RunSynchronizeClassificationSpecifications - Runs a separate pipeline to
synchronize category specifications
SynchronizeGlobalSpecifications
Name:
SynchronizeGlobalSpecifications
Description: This pipeline is responsible for synchronizing global specifications
The specifications and the tables for fixed key-value pairs are stored under
“/sitecore/content/Product Artifacts/Lookups/Global Product Specification
Lookups”
Usage: Called internally from pipeline SynchronizeSpecifications
Args:
Request - Is set prior to calling the pipeline.
Response - Is read after the pipeline is called.
Processors:
ReadGlobalSpecificationsFromSC – Optional
Reads the product specifications data from SC. This processor can be skipped if
changes only are pushed from ECS to SC.
ReadGlobalSpecificationsFromECS – Mandatory
Reads the product specifications data from ECS
ResolveGlobalSpecificationsChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveGlobalSpecificationsToECS – Optional
Saves synchronized product specifications data to ECS. This processor can be
skipped if changes only are pushed from ECS to SC.
SaveGlobalSpecificationsToSC – Mandatory
Saves synchronized product specifications data to SC.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 132 of 142
The Commerce Connect Developer's Guide
SynchronizeTypeSpecifications
Name:
SynchronizeTypeSpecifications
Description: This pipeline is responsible for synchronizing type specifications
The specifications and the tables for fixed key-value pairs are stored under
“/sitecore/content/Product Artifacts/Product Types”
Note: For types also specification options and default values are synchronized
as part of this pipeline
Usage: Called internally from pipeline SynchronizeSpecifications
Args:
Request - Is set prior to calling the pipeline.
Response - Is read after the pipeline is called.
Processors:
ReadTypeSpecificationsFromSC – Optional
Reads the product specifications data from SC. This processor can be skipped if
changes only are pushed from ECS to SC.
ReadTypeSpecificationsFromECS – Mandatory
Reads the product specifications data from ECS
ResolveTypeSpecificationsChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveTypeSpecificationsToECS – Optional
Saves synchronized product specifications data to ECS. This processor can be
skipped if changes only are pushed from ECS to SC.
SaveTypeSpecificationsToSC – Mandatory
Saves synchronized product specifications data to SC.
SynchronizeClassificationSpecifications
Name:
SynchronizeClassificationSpecifications
Description: This pipeline is responsible for synchronizing Category specifications
The specifications and the tables for fixed key-value pairs are stored under
“/sitecore/content/Product Artifacts/Classifications”
Note: Since multiple different classification schemes are supported, this pipeline
is responsible for synchronizing specifications for all schemes
Usage: Called internally from pipeline SynchronizeSpecifications
Args:
Request - Is set prior to calling the pipeline.
Response - Is read after the pipeline is called.
Processors:
ReadClassificationSpecificationsFromSC – Optional
Reads the classifications specifications data from SC. This processor can be
skipped if changes only are pushed from ECS to SC.
ReadClassificationSpecificationsFromECS – Mandatory
Reads the classifications specifications data from ECS
ResolveClassificationSpecificationsChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveClassificationSpecificationsToECS – Optional
Saves synchronized classifications specifications data to ECS. This processor
can be skipped if changes only are pushed from ECS to SC.
SaveClassificationSpecificationsToSC – Mandatory
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 133 of 142
Sitecore Commerce Connect 7.2
After running the pipeline the categories will have a folder called Specifications containing all the
specifications for the category, including tables with fixed set key-value pairs for reference from
products.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 134 of 142
The Commerce Connect Developer's Guide
SynchronizeProduct
SynchronizeProduct is used to synchronize a single product between the external commerce system
and Sitecore. The product to synchronize is given by Id.
Name:
SynchronizeProduct
Description: This pipeline is responsible for synchronizing a single product by calling a
number of individual pipelines. Each pipeline will update the references between
the product and the related separate repositories except pipeline
SynchronizeProductItem, which operates on the main product data on the
product item itself.
SynchronizeProductManufacturers
SynchronizeProductManufacturers is used to synchronize references between a single product and
separate repository Manufacturers between the external commerce system and Sitecore. The product
to synchronize is given by external product Id.
Name:
SynchronizeProductManufacturers
Description: This pipeline is responsible for synchronizing and updating the relation between
a given product and manufacturers.
It’s assumed that manufacturers are already synchronized and present in CMS
The references to manufacturers are stored directly on the main product item
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id. Is set prior to calling the pipeline.
Response - Contains the Manufacturer. Is read after the pipeline is called.
Processors:
ReadProductManafacturersFromSC – Optional
Reads the product manafacturers reference data from SC. This processor can
be skipped if changes only are pushed from ECS to SC.
ReadProductManafacturersFromECS – Mandatory
Reads the product manafacturers reference data from ECS
ResolveProductManafacturersChanges – Optional
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 135 of 142
Sitecore Commerce Connect 7.2
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveProductManafacturersToECS – Optional
Saves synchronized product manafacturers reference data to ECS. This
processor can be skipped if changes only are pushed from ECS to SC.
SaveProductManafacturersToSC – Mandatory
Saves synchronized product manafacturers reference data to SC.
SynchronizeProductType
Name:
SynchronizeProductType
Description: This pipeline is responsible for synchronizing and updating the references
between a given product and its product type.
It’s assumed that types are already synchronized and present in CMS
The references to product type is stored directly on the main product item
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id. Is set prior to calling the pipeline.
Response - Contains the Manufacturer. Is read after the pipeline is called.
Processors:
ReadProductTypeFromSC – Optional
Reads the product type reference data from SC. This processor can be skipped
if changes only are pushed from ECS to SC.
ReadProductTypeFromECS – Mandatory
Reads the product type reference data from ECS
ResolveProductTypeChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveProductTypeToECS – Optional
Saves synchronized product type reference data to ECS. This processor can be
skipped if changes only are pushed from ECS to SC.
SaveProductTypeToSC – Mandatory
Saves synchronized product type reference data to SC.
SyncronizeProductClassifications
Name:
SynchronizeProductClassifications
Description: This pipeline is responsible for synchronizing and updating the references
between a given product and associated classifications and categories within.
It’s assumed that classifications are already synchronized and present in CMS
The references to categories are stored directly on the main product item
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id. Is set prior to calling the pipeline.
Response - Contains the Manufacturer. Is read after the pipeline is called.
Processors:
ReadProductClassificationsFromSC – Optional
Reads the product classification reference data from SC. This processor can be
skipped if changes only are pushed from ECS to SC.
ReadProductClassificationsFromECS – Mandatory
Reads the product classification reference data from ECS
ResolveProductClassificationsChanges – Optional
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 136 of 142
The Commerce Connect Developer's Guide
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveProductClassificationsToECS – Optional
Saves synchronized product classification reference data to ECS. This
processor can be skipped if changes only are pushed from ECS to SC.
SaveProductClassificationsToSC – Mandatory
Saves synchronized product classification reference data to SC.
SynchronizeProductEntity
Name:
SynchronizeProductEntity
Description: This pipeline is responsible for synchronizing and updating the main product
entity (data( for the product with the given external product ID.
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id. Is set prior to calling the pipeline.
Response - Contains the Manufacturer. Is read after the pipeline is called.
Processors:
ReadProductFromSC – Optional
Reads the product data from SC. This processor can be skipped if changes only
are pushed from ECS to SC.
ReadProductFromECS – Mandatory
Reads the product data from ECS
ResolveProductChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveProductToECS – Optional
Saves synchronized product data to ECS. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveProductToSC – Mandatory
Saves synchronized product data to SC.
SynchronizeProductDivisions
Name:
SynchronizeProductDivisions
Description: This pipeline is responsible for synchronizing and updating the references
between a given product and associated divisions.
It’s assumed that divisions are already synchronized and present in CMS
The references to divisions are stored directly on the main product item
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id. Is set prior to calling the pipeline.
Response - Contains the Manufacturer. Is read after the pipeline is called.
Processors:
ReadProductDivisionsFromSC – Optional
Reads the product divisions reference data from SC. This processor can be
skipped if changes only are pushed from ECS to SC.
ReadProductDivisionsFromECS – Mandatory
Reads the product divisions reference data from ECS
ResolveProductDivisionsChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 137 of 142
Sitecore Commerce Connect 7.2
SaveProductDivisionsToECS – Optional
Saves synchronized product divisions reference data to ECS. This processor
can be skipped if changes only are pushed from ECS to SC.
SaveProductDivisionsToSC – Mandatory
Saves synchronized product divisions reference data to SC.
SynchronizeProductResources
Name:
SynchronizeProductDivisions
Description: This pipeline is responsible for synchronizing and updating the references
between a given product and associated resources.
It’s assumed that resources are already synchronized and present in CMS or
that the references are external using an URI to point to the location
The references to resources are stored under the main product item on the path
“[Product Item]/Resources/[Resource]”
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id. Is set prior to calling the pipeline.
Response - Contains the Manufacturer. Is read after the pipeline is called.
Processors:
ReadProductResourcesFromSC – Optional
Reads the product resources reference data from SC. This processor can be
skipped if changes only are pushed from ECS to SC.
ReadProductResourcesFromECS – Mandatory
Reads the product resources reference data from ECS
ResolveProductResourcesChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveProductResourcesToECS – Optional
Saves synchronized product resources reference data to ECS. This processor
can be skipped if changes only are pushed from ECS to SC.
SaveProductResourcesToSC – Mandatory
Saves synchronized product resources reference data to SC.
SynchronizeProductRelations
Name:
SynchronizeProductRelations
Description: This pipeline is responsible for synchronizing product relations for a single
product
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id . Is set prior to calling the pipeline.
Response - Contains the Product relations. Is read after the pipeline is called.
Processors:
ReadProductRelationsFromSC - Reads the product relations data from SC.
This processor can be skipped if changes only are pushed from ECS to SC.
ReadProductRelationsFromECS – Reads the product relations data from ECS
ResolveProductRelationsChanges – Resolves differences between ECS and
SC. This processor can be skipped if changes only are pushed from ECS to SC.
SaveProductRelationsToECS – Saves synchronized product relations data to
ECS. This processor can be skipped if changes only are pushed from ECS to
SC.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 138 of 142
The Commerce Connect Developer's Guide
SynchronizeProductSpecifications
Name:
SynchronizeProductSpecifications
Description: This pipeline is responsible for synchronizing product specifications for a single
product.
It’s assumed that specification tables of fixed key-value pairs (lookups) are
already synchronized and present in CMS when this pipeline is run
The references to specifications are stored under the main product item on the
path “[Product Item]/Specifications/[Specification]”
Specifications that reference lookup tables can point to specification tables
located under global, classification or type.
Usage: Called internally from pipeline SynchronizeProduct
Args:
Request - Contains the external product Id . Is set prior to calling the pipeline.
Response - Contains the Product relations. Is read after the pipeline is called.
Processors:
ReadProductSpecificationsFromSC - Optional
Reads the product specification data from SC. This processor can be skipped if
changes only are pushed from ECS to SC.
ReadProductSpecificationsFromECS – Mandatory
Reads the product specification data from ECS
ResolveProductSpecificationChanges – Optional
Resolves differences between ECS and SC. This processor can be skipped if
changes only are pushed from ECS to SC.
SaveProductSpecificationsToECS – Optional
Saves synchronized product specification data to ECS. This processor can be
skipped if changes only are pushed from ECS to SC.
SaveProductSpecificationsToSC – Mandatory
Saves synchronized product specification data to SC.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 139 of 142
Sitecore Commerce Connect 7.2
In an actual Connect provider implementation, the custom objects are known and don’t necessarily
have to be created through use of Factory.
You can use references to the factory as a parameter in some processors, for example,
CreateCart:
<processor type="Sitecore.Commerce.Pipelines.Carts.CreateCart.CreateCart,
Sitecore.Commerce">
<param ref="entityFactory" />
</processor>
You must use the Factory.Create method to get an instance of the needed type. For example, in
the following code snippet, we need a cart and calls the factory to create and return a cart. The cart
domain model can be completely modified and customized so that you can replace the default cart
type with your own implementation:
public override void Process(ServicePipelineArgs args)
{
var result = (CartResult)args.Result;
var cart = this.entityFactory.Create<Cart>("Cart");
var request = (CreateOrResumeCartRequest)args.Request;
cart.UserId = request.UserId;
cart.ShopName = request.ShopName;
cart.CartName = request.CartName;
cart.CustomerId = request.CustomerId;
cart.CartStatus = CartStatus.InProcess;
result.Cart = cart;
}
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 140 of 142
The Commerce Connect Developer's Guide
Pipeline Description
getCarts This pipeline searches for all carts that match some specific criteria. The
carts are managed by the commerce system. This pipeline reads cart
data from the commerce system and converts that data into Connect
format.
createOrResumeCart This pipeline:
Initiates the creation of a shopping cart.
Loads persisted, abandoned cart, if present.
Calls resumeCart pipeline to resume loaded cart.
Calls createCart pipeline to create cart if no cart was found in
the previous steps.
createCart This pipeline:
Is internally used by the createOrResumeCart pipeline if the
existing cart was not found and should be created.
Creates a cart with the minimal number of required fields.
Moves a visitor to the initial state in the engagement plan.
Saves a cart to the storage and triggers the CartCreate
event.
resumeCart This pipeline:
Is internally used by the createOrResumeCart pipeline if a
cart was loaded and should be resumed.
Sets the initial state to the loaded cart, moves a visitor to the
initial state in the engagement plan.
Saves a cart to the storage and triggers the CartResume
event.
loadCart This pipeline:
Gets a cart object that matches a specified criteria.
Reads data for a cart that is managed by the commerce system.
Reads the cart data from the commerce system and converts
that data into the Connect format.
saveCart This pipeline saves the cart object to an external system and in Sitecore
EA state.
addCartLines This pipeline adds a new line to the shopping cart and records a
corresponding page event in DMS.
This happens when a product is added to the cart.
removeCartLines This pipeline removes cart lines from cart.
updateCartLines This pipeline updates lines on cart.
deleteCart This pipeline:
Deletes a cart permanently:
When the cart is deleted, it triggers the event in DMS to indicate
that the cart is deleted.
updateCart This pipeline:
Passes an updated cart to the external commerce system.
Triggers an event in DMS to indicate that the cart is being
updated.
lockCart This pipeline sets the cart to a locked state and prevents any
modifications.
unlockCart This pipeline sets the cart to an unlocked state.
getCartTotal This pipeline:
Gets the totals object that matches the specified criteria.
Is responsible for reading pricing data from a commerce
system.
Converts the contents of a Connect cart into a format the
commerce system can work with.
Sends a request to the commerce system to calculate the totals,
and converts the output into the proper Connect format.
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 141 of 142
Sitecore Commerce Connect 7.2
Sitecore® is a registered trademark. All other brand and product names are the property of their respective holders. The
contents of this document are the property of Sitecore. Copyright © 2001-2014 Sitecore. All rights reserved.
Page 142 of 142