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
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 Calls the |
|
Usage: |
Called from Sitecore when a visitor is registering for an account. It could be during the checkout process or through plain signup. |
|
Signature: |
|
|
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
UpdateUser method
|
Name: |
UpdateUser |
|
Description: |
Updates an existing user account. Calls the |
|
Usage: |
Called from Sitecore when a visitor wants to update the information stored on the account. |
|
Signature: |
|
|
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
DeleteUser method
|
Name: |
DeleteUser |
|
Description: |
Deletes a user account. Calls the |
|
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: |
|
|
Input: | |
|
CommerceUser – An instance of the CommerceUser object is parsed in | |
|
Output: | |
|
SystemMessages - Collection of messages from the external system. |
Usage example:
DisableUser method
DisableUser method
|
Name: |
DisableUser |
|
Description: |
Disables a user account. Calls the |
|
Usage: |
Called from Sitecore when the user account should be disabled. |
|
Signature: |
|
|
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
EnableUser method
|
Name: |
EnableUser |
|
Description: |
Enables a user account. Calls the 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 The |
|
Usage: |
Called from Sitecore when the user account should be enabled. |
|
Signature: |
|
|
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
GetUser method
|
Name: |
GetUser |
|
Description: |
Returns a single user account. Calls the |
|
Usage: |
Called from Sitecore when searching for one or more accounts. |
|
Signature: |
|
|
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
GetUsers method
|
Name: |
GetUsers |
|
Description: |
Queries and returns user accounts. Calls the 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: |
|
|
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:
AddUsers method
AddUsers method
|
Name: |
AddUsers |
|
Description: |
Add a user to a customer. Calls the |
|
Usage: |
Called to associate a user to a visitor. |
|
Signature: |
|
|
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:
RemoveUsers method
RemoveUsers method
|
Name: |
RemoveUsers |
|
Description: |
Removes users from a customer. Calls the |
|
Usage: |
Called to remove an associated user to a visitor. |
|
Signature: |
|
|
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:
CreateCustomer method
CreateCustomer method
|
Name: |
CreateCustomer |
|
Description: |
Creates a customer. Calls the |
|
Usage: |
Typically called when a visitor is going through the checkout process. |
|
Signature: |
|
|
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
UpdateCustomer method
|
Name: |
UpdateCustomer |
|
Description: |
Updates an existing customer account. Calls the |
|
Usage: |
Called from Sitecore when a visitor or shop owner wants to update the information stored on the customer account. |
|
Signature: |
|
|
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
DisableCustomer method
|
Name: |
DisableCustomer |
|
Description: |
Disables a customer account. Calls the |
|
Usage: |
Called from Sitecore when the customer account should be disabled. |
|
Signature: |
|
|
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
EnableCustomer method
|
Name: |
EnableCustomer |
|
Description: |
Enables a customer account. Calls the |
|
Usage: |
Called from Sitecore when the customer account should be enabled. |
|
Signature: |
|
|
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
DeleteCustomer method
|
Name: |
DeleteCustomer |
|
Description: |
Deletes a customer account. Calls the |
|
Usage: |
Called when an account should be deleted. It is a solution business decision whether the account is actually deleted or simply disabled. |
|
Signature: |
|
|
Input: | |
|
CommerceCustomer – An instance of the CommerceCustomer object is parsed in. | |
|
Output: | |
|
SystemMessages - Collection of messages from the external system. |
Usage example:
GetCustomer method
GetCustomer method
|
Name: |
GetCustomer |
|
Description: |
Returns a single customer instance. Calls the |
|
Usage: |
Called from Sitecore when searching for an account. |
|
Signature: |
|
|
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
GetCustomers method
|
Name: |
GetCustomers |
|
Description: |
Queries and returns customer entities. Calls the Different input parameters can be provided and they will be combined using logical and. |
|
Usage: |
Called from Sitecore when searching for an account. |
|
Signature: |
|
|
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<CommerceCustomer> | |
|
SystemMessages - Collection of messages from the external system. |
Usage example:
AddCustomers method
AddCustomers method
|
Name: |
AddCustomers |
|
Description: |
Add a customer to a user. Calls the |
|
Usage: |
Called to associate a visitor to a user. |
|
Signature: |
|
|
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:
RemoveCustomers method
RemoveCustomers method
|
Name: |
RemoveCustomers |
|
Description: |
Removes customers from a user. Calls the |
|
Usage: |
Called to remove an associated visitor to a user. |
|
Signature: |
|
|
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:
AddCustomerParties method
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: |
|
|
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:
RemoveCustomerParties method
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: |
|
|
Input: | |
|
Customer – CommerceCustomer. Mandatory. An instance of the customer. | |
|
Parties – List<Party>. Mandatory. 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
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: |
|
|
Input: | |
|
Customer – CommerceCustomer. Mandatory. An instance of the customer. | |
|
Parties – List<Party>. Mandatory. 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
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: |
|
|
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:
UpdateParties method
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: |
|
|
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:
AddParties method
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: |
|
|
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:
RemoveParties method
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: |
|
|
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:
UpdatePassword method
UpdatePassword method
|
Name: |
UpdatePassword |
|
Description: |
Change the user password. Calls the |
|
Usage: |
Called from Sitecore when the password must be changed. |
|
Signature: |
|
|
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: