Customers and users
Both users and customers are consumers of your external commerce system (ECS) webshop. The User (CommerceUser) account is used primarily for authentication purposes and to expose the user to DMS. The customer (CommerceCustomer) account is used to represent the customer in the ECS who will receive and pay for the submitted orders.
In simple B2C scenarios the CommerceUser and the CommerceCustomer entities represent two aspects of the customer, whereas in B2B scenarios the CommerceUser represents the person acting on behalf of the customer, which typically represents an organization or company.
There is a many-to-many relationship between customers and users and there could be customers without users (anonymous checkout, without registration, for example), but normally users would not be without customers.
There are many different ways to use Connect with an ECS for customers and users:
-
To pass customer and user information between the ECS and Sitecore.
-
To set and/or get customer information during checkout.
-
To register accounts for new users.
-
To authenticate (for example, login or logout registered users).
-
To enter a user into an engagement automation (EA) plan when creating a user account and trigger goals when logging in.
Configuration
Configuration
You can find all configuration for the customer subsystem in the Sitecore.Commerce.Customers.config file. Here you will find all details for the entities, pipelines, and repositories used by the customer and user system.
Entities
Entities
The default customer entities for Commerce Connect only assume some of the basic customer and user information that will be used across all commerce systems; it is expected that you will need to extend these entities.
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.
You can use the following five entities defined in the Connect system for customers and users to extend functionality to suit your needs:
-
CommerceCustomer- is always extended to include custom information particular to the external commerce system (ECS). -
CommerceUser- is always extended to include custom information particular to the external commerce system (ECS). -
CustomerParty - represents the type and 0-to-many relationship between the customer and a list of parties, where parties are of type Party. -
CustomerPartyType- indicates the type of relationship between the customer and party. The class is introduced as an extensible enum. To extend and customize the options, Connect has two party types:AccountingPartyandBuyerParty. -
Party- a shared entity between the carts service layer and the customer and users service layer. This entity stores party information, for example, address information.To extend any of these default entities, you create a new class that inherits from the relevant type and then patch the relevant entity under commerce.Entities in the
Sitecore.Commerce.Customers.configfile.
Pipelines
Pipelines
There are numerous pipelines for customers and users that provide most basic functionality.
For example:
-
CreateCustomerandCreateUserpipelines - used to create customers and users. -
UpdateCustomerandUpdateUserpipelines - used to update customers and users. -
DeleteCustomerandDeleteUserpipelines - used to delete customers and users. -
AddCustomersandAddUserspipelines - used to associate customers to users. -
AddPartiespipelines - used to add party information.
For more information, see the Commerce Connect Developer Reference.