Customer service methods
Service providers are wrapper objects designed to make it easier to interact with Connect pipelines. The providers implement no logic other than calling pipelines. All of the business logic is implemented in the pipeline processors.
For each method there is a corresponding Request and Result object returned, for example, 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 method
| Name: | CreateUser |
|---|---|
| Description: | Creates a user account by which the user can re-authenticate themselves upon return. By default the account is disabled until it has be confirmed by the visitor to be a valid request and ActivateUserAccount has been called.Calls the CreateUser pipeline. |
| 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:
UpdateUser method
| Name: | UpdateUser |
|---|---|
| Description: | Updates an existing user account. Calls the UpdateUser pipeline. |
| Usage: | Called from Sitecore when a 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:
DeleteUser method
| Name: | DeleteUser |
|---|---|
| Description: | Deletes a user account. Calls the DeleteUser pipeline. |
| Usage: | Called from Sitecore when the shop owner wants to delete an account. It is 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:
DisableUser method
| Name: | DisableUser |
|---|---|
| Description: | Disables a user account. Calls the DisableUser pipeline. |
| 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 an explanation. | |
| Output: | |
| **CommerceUser –**The disabled CommerceUser entity. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
EnableUser method
| Name: | EnableUser |
|---|---|
| Description: | Enables a user account. Calls the EnableUser pipeline.A user account can be disabled for different reasons and triggered by the shop owner or visitor. 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 the ActivateUserAccount method because they both enable the account. The difference lies in the usage scenario and possible actions associated.The EnableUser method is a generic method whereas the UserAccountActivation method 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. |
| 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 an explanation. | |
| Output: | |
| **CommerceUser –**The enabled CommerceUser entity. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
GetUser method
| Name: | GetUser |
|---|---|
| Description: | Returns a single user account. Calls the GetUser pipeline. |
| 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:
GetUsers method
| Name: | GetUsers |
|---|---|
| Description: | Queries and returns user accounts. Calls the GetUsers pipeline.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 | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
AddUsers method
| Name: | AddUsers |
|---|---|
| Description: | Add a user to a customer. Calls the AddUsers pipeline. |
| Usage: | Called to associate a user to a visitor. |
| Signature: | AddUsersResult AddUsers(AddUsersRequest request) |
| Input: | |
| **List | |
| Output: | |
| IReadOnlyCollection | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
RemoveUsers method
| Name: | RemoveUsers |
|---|---|
| Description: | Removes users from a customer. Calls the RemoveUsers pipeline. |
| Usage: | Called to remove an associated user to a visitor. |
| Signature: | Remove UsersResult RemoveUsers( RemoveUsersRequest request) |
| Input: | |
| **List | |
| Output: | |
| IReadOnlyCollection | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
CreateCustomer method
| Name: | CreateCustomer |
|---|---|
| Description: | Creates a customer. Calls the CreateCustomer pipeline. |
| 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:
UpdateCustomer method
| Name: | UpdateCustomer |
|---|---|
| Description: | Updates an existing customer account. Calls the UpdateCustomer pipeline. |
| Usage: | Called from Sitecore when a 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:
DisableCustomer method
| Name: | DisableCustomer |
|---|---|
| Description: | Disables a customer account. Calls the DisableCustomer pipeline. |
| 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 an explanation. | |
| Output: | |
| **CommerceCustomer –**The disabled customer. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
EnableCustomer method
| Name: | EnableCustomer |
|---|---|
| Description: | Enables a customer account. Calls the EnableCustomer pipeline. |
| 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 an explanation. | |
| Output: | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
DeleteCustomer method
| Name: | DeleteCustomer |
|---|---|
| Description: | Deletes a customer account. Calls the DeleteUser pipeline. |
| Usage: | Called when an account should be deleted. It is 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:
GetCustomer method
| Name: | GetCustomer |
|---|---|
| Description: | Returns a single customer instance. Calls the GetCustomer pipeline. |
| Usage: | Called from Sitecore when searching for an account. |
| Signature: | GetCustomerResult GetCustomer(GetCustomerRequest request) |
| Input: | |
| **ShopName –**Mandatory. | |
| **ExternalID –**Mandatory. The unique ID of the customer in the given shop. | |
| Output: | |
| **CommerceCustomer –**An instance of the CommerceCustomer if it exists. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
GetCustomers method
| Name: | GetCustomers |
|---|---|
| Description: | Queries and returns customer entities. Calls the GetCustomers pipeline.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: | |
| List | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
AddCustomers method
| Name: | AddCustomers |
|---|---|
| Description: | Add a customer to a user. Calls the AddCustomers pipeline. |
| Usage: | Called to associate a visitor to a user. |
| Signature: | AddCustomersResult AddCustomers(AddCustomersRequest request) |
| Input: | |
| **List | |
| Output: | |
| IReadOnlyCollection | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
RemoveCustomers method
| Name: | RemoveCustomers |
|---|---|
| Description: | Removes customers from a user. Calls the RemoveCustomers pipeline. |
| Usage: | Called to remove an associated visitor to a user. |
| Signature: | RemoveCustomersResult RemoveCustomers(RemoveCustomersRequest request) |
| Input: | |
| **List | |
| Output: | |
| IReadOnlyCollection | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
AddCustomerParties method
| 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 A list of customer parties to associate with the customer. | |
| Output: | |
| **Customer -**Customer. Mandatory. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
RemoveCustomerParties method
| 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. |
| Signature: | RemoveCustomerPartiesResult RemoveCustomerParties (RemoveCustomerPartiesRequest request) |
| Input: | |
| **Customer – CommerceCustomer.**Mandatory. An instance of the customer. | |
| **Parties –List A list of customer parities to un-associate with the customer. | |
| Output: | |
| **Customer -**Customer. Mandatory. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
UpdateCustomerParties method
| 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 A list of customer parties to update on the customer. | |
| Output: | |
| **Customer -**Customer. Mandatory. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
GetParties method
| Name: | GetParties |
|---|---|
| Description: | This method is responsible for getting all the parties. |
| 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 A list of parties | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
UpdateParties method
| 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 A list of parties to update | |
| Output: | |
| **Customer -**Customer. Mandatory. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
AddParties method
| 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 A list of customer parties to add. | |
| Output: | |
| **Customer -**Customer. Mandatory. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
RemoveParties method
| 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 A list of customer parties to remove. | |
| Output: | |
| **Customer -**Customer. Mandatory. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
UpdatePassword method
| Name: | UpdatePassword |
|---|---|
| Description: | Change the user password. Calls the UpdatePassword pipeline. |
| Usage: | Called from Sitecore when the password must be changed. |
| Signature: | UpdatePasswordResult UpdatePassword(UpdatePasswordRequest request) |
| Input: | |
| UserID – MandatoryThe 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: