SalesForce Commerce Cloud: B2B Configurations
Bloomreach Experience Manager can be instantaneously integrated with SalesForce Commerce Cloud: B2B (formerly called CloudCraze B2B) when using Bloomreach Commerce Accelerator. The B2B application contains all the configurations needed to interact with your SalesForce Commerce Cloud: B2B instance.
This page focuses on two points:
- How to connect to your SalesForce Commerce Cloud: B2B instance
- A high-level description of SalesForce Commerce Cloud: B2B connector configurations.
In addition, we also include some details regarding the Federation Integration Authentication.
Connect to a SalesForce B2B instance
Salesforce B2B commerce (formerly known as CloudCraze) is a cloud-based B2B e-commerce solution. The Bloomreach Commerce Accelerator B2B application already provides a CRISP API resource space able to connect to your instance. The related configuration can be found at the following repository path:
You need to provide your specific connection properties explained in the table below:
|salesforcecc.baseUrl||SalesForce B2B instance base URL: please note that it should refer to your StoreFront base URL|
|salesforcecc.username||SalesForce B2B merchant username|
|salesforcecc.password||SalesForce B2B merchant password|
|salesforcecc.securityToken||SalesForce B2B merchant securityTokem, if it exists|
|salesforcecc.accessTokenUri||SalesForce access token URL: typically it matches the hostname where SalesForce B2B is configured|
|SalesForce OAuth connected app consumer key|
|salesforcecc.clientSecret||SalesForce OAuth connected app consumer secret|
|salesforcecc.storefront.user.signin.url||Salesforce B2B VisualForce page sign-in url|
|salesforcecc.storefront.user.signout.url||Salesforce B2B VisualForce page sign-out url|
|salesforcecc.storefront.user.changePassword.url||Salesforce B2B VisualForce page password change url|
|salesforcecc.storefront.locale.language.code||Language code,specified using the language_territory format.|
|salesforcecc.storefront.locale.currency.ISO3code||Currency code, specified using the ISO3 format|
You can define the properties in the Bloomreach Accelerator Configuration File as in the example below (replace project name):
.. # StarterStore parameters for SalesForce CloudCraze backend service. salesforcecc.cache.enabled = (e.g. true or false) salesforcecc.clientId = (e.g your Connected App consumer key) salesforcecc.clientSecret = (e.g. your Connected App consumer secret) salesforcecc.username = (e.g. SalesForce B2B merchant username) salesforcecc.password = salesforcecc.securityToken = salesforcecc.baseUrl = (e.g. https://<your_instance>.force.com/DefaultStore) salesforcecc.accessTokenUri = (e.g. https://<your_region>.salesforce.com) salesforcecc.storefront.user.signin.url = (e.g. https://<your_instance>.force.com/DefaultStore/SiteLogin?startURL=/CustomSiteLogin) salesforcecc.storefront.user.signout.url = (e.g. https://<your_instance>.force.com/DefaultStore/secur/logout.jsp) salesforcecc.storefront.user.register.url = (e.g. https://<your_instance>.force.com/DefaultStore/UserRegister) salesforcecc.storefront.user.changePassword.url = (e.g. https://<your_instance>.force.com/DefaultStore/ChangePassword) salesforcecc.storefront.locale.language.code = (e.g en_US) salesforcecc.storefront.locale.currency.ISO3code = (e.g. USD) ..
The current connector version is based on SalesForce B2B Commerce Cloud 4.9: for this reason we kindly advice to consider the related documentation pages.
The Bloomreach Commerce Accelerator B2B application provides an out-of-the-box commerce connector definition for SalesForce B2B. You can find the related Commerce Connector document under the commerce-connectors folder, with name Salesforce B2B.
The module name is com.bloomreach.commercedxp.b2b.container.connector.salesforcecc and matches the HST module addon name specified in the connector implementation.
The Resource space property matches with SalesForce B2B CRISP API resource space name for the SalesForce backend.
As you can read in Install B2B Commerce, the B2B Commerce Accelerator may work in combination with the SalesForce B2B Visual force pages. As example, the current version of the B2B project delegates operations like user (contact) sign-in and sign-up directly to SalesForce.
The table below contains all the Connector components used for the SalesForce B2B connector. Please consider that all the customer-specific requests will include the ccrz-context data, as described in the REST API context handling section.
|B2B customer (contacts) sign-in process is delegated to SalesForce: this component is responsible for checking the temporaty token issued by the SiteLogin controller. More details in the Federated Login section below.
|productSearch||Find products using a keyword. More info here|
|productSearchById||Fetch products using the id. More info here|
|productFindFilters||Retrieve produc filters (similar to product facets). More info here|
|categorySearch||Fetch categories using id. More info here|
|categorySearchBySOQL||Search caetgoories using the SalesForce Objects REST API|
|cartCreate||More info here|
|cartRetrieve||Fetch a cart using a specific id. More info here|
|getActiveCart||Retrieve the cart currently use by the store user. More info here|
|cartProductAdd||More info here|
|cartProductRemove||More info here|
|cartDelete||More info here|
|cartReprice||Apply cart toal amount re-calculation. More info here|
|getAccountProfile||Fetch account details. More info here|
|searchAllAccounts||Retrieve the B2B accounts using the SalesForce Data REST API|
|searchAccountsNameLike||Retrieve the B2B accounts matching the name specified: the SalesForce Data REST API is used.|
|getAccountAddressBooks||Fetch the address books associated to the store user. More info here|
|createAccountAddressBooks||Create address books for a specific store user. More info here|
|updateAccountAddressBooks||Update address books for a specific store user. More info here|
|deleteAccountAddressBooks||Delete address books for a specific store user. More info here|
|getAddresses||Fetch the address with a specific id. More info here|
|createAddresses||More info here|
|updateAddresses||More info here|
|getCustomerProfile||Get the user profile data. More info here|
|updateCustomerProfile||Update user profile data. More info here|
|orderSearch||Fetch orders placed by the store users. More info here|
|orderRevise||Revise a pending order (aka order draft). More info here|
|orderPlacement||Place an order. More info here|
|reorder||Creates a new order draft out of existing order. More info here|
|Fetch Store User related invoices. More info here|
|storedPaymentSearch||Fetch a stored payment method. More info here|
|storedPaymentCreate||Create a new stored payment (e.g. Purchase Order). More info here|
|storedPaymentUpdate||Update an existing stored payment. More info here|
|storedPaymentDelete||Delete an existing stored payment. More info here|
|opportunityCreate||Create a new sales opportunity in Salesforce. As example, it may be triggered by a request for quote sent by existing customers. SalesForce Data API is used|
|leadCreate||Create a new sales lead in Salesforce. As example, it may be triggered by a request for quote sent by anonymous customers. SalesForce Data API is used|
|wishListSearch||More info here|
|wishListCreate||More info here|
|wishListAddTo||Add a new product to the wishlist. More info here|
|wishListUpdate||More info here|
|wishListDelete||More info here|
SalesForce B2B Commerce v4.9 doesn't expose a public REST API for user (contact) registration. For this reason, the Accelerator provides a federated authentication integration: this solution consists of custom VisualForce pages and controllers that can be installed on top of your SalesForce B2B instance.
The authentication process is depicted in the image below. First of all you need to configure the SalesForce storefront: more specifically, you need to ensure that VisualForce pages - powering functionalities like user sign-in - are exposed and accessible. Please also ensure that your Accelerator instance is only accepting HTTPs requests.
Some important details about the flow depicted above:
- The visitor access to the B2B Commerce Accelerator and tries to login;
- The Accelerator application redirects the visitor to the Salesforce storefront, more specifically to the login page powered by the VisualForce page (called "SiteLogin");
- The visitor fills the login form;
- If the previous step goes well - hence user credentials are accepted - the visitor gets redirected to a temporary page called "SitePostLogin". This page is mainly responsible for creating a temporary token. This is stored in the Salesforce platform cache. Eventually the visitor is redirected back to the Accelerator application. The redirection also includes the token just issued, as a parameter of the redirect URL;
- The HST component responsible for the federated login receives the token and initiates the token validity check;
- The token validation is handled by the SitePostLogin controller (the same one used in step 4);
- A validation result will be sent back to the server side component. If the validation succeeds, the response will also include the details of the authenticated user.
Once the login process is over, the Accelerator application temporarly stores that authenticated user data. This data is used for every user-specific request, by sending the related ccrz-context parameter as part of the header.