Headless Commerce with the Bloomreach Starter Store for Elastic Path
Giacomo Lamonaco
2019-06-28
The Starter Store Boot project is designed as an out-of-the-box accelerator to integrate your commerce backend with Bloomreach Experience Manager and Bloomreach Search & Merchandising. The Boot project can be configured with a commerce backend platform such as Elastic Path. You can use any of the available commerce backend configurations.
This page explains how to set up the Starter Store Boot project in your local development environment and connect your Elastic Path commerce backend platform.
Set Up Local Development Environment
The Starter Store Boot project is available in the Bloomreach Experience Manager Enterprise Maven repository.
Log in at https://maven.onehippo.com/.
Point your browser to /maven2-enterprise/com/bloomreach/commercedxp/starterstore-boot/
Pick the appropriate release (version number of the format X.Y.Z) and open the corresponding folder.
Download the starterstore-boot-X.Y.Z-project.tar.gz (or .tar.bz2 or .zip) source distribution and extract it to a folder in your local environment.
Connect to an Elastic Path instance
Elastic Path commerce is an e-commerce solution that supports both cloud-based and on-premise installation. In either case, the Starter Store boot application provides a CRISP API resource space able to connect to your instance. The related configuration can be found at the following repository path:
/hippo:configuration/hippo:modules/crispregistry/hippo:moduleconfig/crisp:resourceresolvercontainer/elasticpath
You need to provide your specific connection properties explained in the table below:
Property name | Description |
elasticpath.baseUrl | The base url of your Elastic Path cortex instance (e.g https://<instance_name>.elasticpath.com/cortex) |
elasticpath.accessTokenUri |
The uri need to obtain your access token (e.g. https://<instance_name>.elasticpath.com/cortex/oauth2/tokens) |
elasticpath.username | Your Elastic Path username |
elasticpath.password | Your Elastic Path password |
elasticpath.scope | Your Elastic Path store name |
elasticpath.role | Your Elastic Path authentication role |
Those properties must be defined directly in the hst.properties. The Starter Store Boot Application contains a root folder called conf: among others, this folder contains a properties file called hst.properties. You can define the properties as in the example below (replace project name):
..
elasticpath.cache.enabled = true
elasticpath.baseUrl = <your_elasticpath_commerce_instance>/cortex
elasticpath.accessTokenUri = <your_elasticpath_commerce_instance>/cortex/oauth2/tokens
elasticpath.username =
elasticpath.password =
elasticpath.scope = <your_store_name>
elasticpath.role = PUBLIC
..
Please note that three parameters above (username, password and role) have been intentionally fixed. The main reason is that the Elastic Path connector has been developed without using a merchant account. This means that in the case of an anonymous Starter Store user, the PUBLIC role will be always used. Once customers authenticate against the Starter Store the underlying session will be converted using the REGISTERED role: customer specific operation (e.g. cart management, checkout) will be now available.
Example:
# Starter Store parameters for bloomreach backend service.
bloomreach.cache.enabled = false
bloomreach.account.id = 0000
bloomreach.api.base.url = http://brm-core-0.brsrvr.com/api/v1/core/
bloomreach.domain.key = domain_key_here
# Commerce Connector Parameters for ElasticPath Commerce Connector Module.
elasticpath.cache.enabled = true
elasticpath.baseUrl = http://instance_name.epdemos.com/cortex
elasticpath.accessTokenUri = http://instance_name.epdemos.com/cortex/oauth2/tokens
elasticpath.username =
elasticpath.password =
elasticpath.scope = ep_scope
elasticpath.role = PUBLIC
Build the application using Maven:
mvn clean verify
Run the application:
mvn -P cargo.run
Verify that the Bloomreach Experience Manager CMS application is accessible at http://localhost:8080/cms/ (login with credentials admin/admin).
To verify that your commerce backend connection is working properly, navigate to the Content perspective and browse to Starter Store Boot Project > products. Open one of the example product documents or create a new one, make sure your commerce backend is selected under Commerce Connector, then click Browse under Related External Product. You should be able to browse through the products in your commerce backend.
Connector configurations
The Starter Store boot application provides an out-of-the-box commerce connector definition for Elastic Path: you can find the related Commerce Connector document under the commerce-connectors folder, with the Connector ID with value elasticpath.
The Elastic Path connector is based on the SDK API. The Resource space property matches with Elastic Path CRISP API resource space name for the Elastic Path backend.