The customer domain model

Current version: 10.2

Class: CommerceUser

The CommerceUser class is responsible for representing a user account. A user resembles a visitor of a webshop (website) who has identified themselves 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 relate to a user:

  • A user represents a person who can log in to a website. For example, meaning that an account exists for that user in the system.

  • A visitor going through the checkout without registering a user account. For example, an anonymous checkout is created as a customer, but without a user account.

  • Customer and User relationship:

    • A user can represent multiple different customers acting as an agent on the customer’s behalf.

    • A customer, such as a company, can have multiple users representing the company. For example, employees of different departments.

    • Based on the two previous statements, this 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.

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 themselves 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 a welcome mail to new users.

  • When the shop owner wants to follow-up on new users that have not returned to the shop for some time (B2C).

    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.

    ID

    String

    Unique ID.

    Email

    String

    The users e-mail address.

    FirstName

    String

    LastName

    String

    Shops

    List<String>

    The list of shops the user has access to.

    Disabled

    Boolean

    Indicates if the user account is disabled or not.

    Comment

    String

    Free text comment.

    CreationDate

    DateTime

    Gets the date and time when the account was added.

    LastActivityDate

    DateTime

    Gets or sets the date and time when the user was last authenticated or accessed the shop.

    LastLoginDate

    DateTime

    Gets or sets the date and time when the user was last authenticated.

    LastDisabledDate

    DateTime

    Gets the most recent date and time when the user account was disabled.

    LastPasswordChangedDate

    DateTime

    Gets the date and time when the user's password was last updated.

    Customers

    List<string>

    The list of customer IDs of the customers that the user is associated with

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.

The following assertions relate to a customer:

  • A customer represents a person in B2C shops and a company in B2B shops.

  • A customer account cannot be used to log in to the webshop. In order to log in, a user account is needed. A Customer account is different from a user account and the two can carry different information.

  • Not all commerce systems support the concept of both a user and a customer. For example: SES only has users whereas InSite Commerce has both customers and users.

    • When the external system does not support customers, the information might be stored together in the User profile, but the Relation will typically not be available.

  • In B2C scenarios a customer and a user is typically the same.

  • In B2B scenarios a customer typically has one-to-many users associated:

    • A customer is typically the one paying the invoices for the orders placed in the system by its users.

    • Users are the ones managing shopping carts on behalf of the customer and go through the checkout process, placing the order.

    • A customer can have multiple shopping carts associated and they can be managed by one or many different users

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 a 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 have not placed orders in the shop for some time.

    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.

    If ASP.NET is used, then the ExternalUserId will equal UserName.

    Will be empty until the account has been created in the external system.

    Name

    String

    The name of the customer.

    ID

    String

    Unique ID.

    IsDisabled

    Boolean

    Indicates if the customer account is disabled or not.

    Shops

    List<String>

    The list of shops the customer has access to.

    CustomerParties

    List<CustomerParty>

    The list of parties consisting of contact and address information.

    CommerceUsers

    List<string>

    The list of user IDs of the users that the customer is associated with.

Class: CustomerParty

The CustomerParty class is used to represent the type and zero-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.

Name

String

An optional string that describes the relationship.

Type

CustomerPartyTypes

Represents the type of relationship.

Class: CustomerPartyTypes

The CustomerPartyTypes class 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:

RequestResponse
public class MyECSCustomerPartyTypes : CustomerPartyTypes
{
    public const int MyCustomPartyType = 3;
      public MyECSCustomerPartyTypes(int value : base(value)
      {   }
}

Name

Type

Description

BuyerParty

public const int BuyerParty = 1

BuyerParty represents the buyer and is typically used as the party where products are shipped to.

AccountingParty

public const int AccountingParty = 2

AccountingParty represents the buyer and is typically used as the party where the invoice is sent to.

Class: Party

The CustomerParty entity represents address contact information and a list of CustomerParty objects is included in the Customer class

Note that the CustomerParty object is used in both the customer and order service layers.

Name

Type

Description

ExternalID

String

Unique identifier for the party

PartyID

String

ID of the party

FirstName

String

First name

LastName

String

Last name

Email

String

E-mail address

Company

String

Company name

Address1

String

Street name

Address2

String

Region, District, County, and so on.

ZipPostalCode

String

Zip/Postal code

City

String

City name

State

String

State

Country

String

Country name

PhoneNumber

String

Phone number

Do you have some feedback for us?

If you have suggestions for improving this article,