Elastic Path Configurations
Introduction
Bloomreach Experience Manager can be instantaneously integrated with Elastic Path when using Bloomreach Commerce Accelerator. The B2C application contains all the configurations needed to interact with your Elastic Path instance.
This page focuses on two points:
- How to connect to your Elastic Path instance.
- A high-level description of Elastic Path connector configurations.
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 Bloomreach Commerce Accelerator B2C 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 |
elasticpath.default.item.original.image.uri |
The URI pattern of the original image of a product item, which is used when the backend does not provide product image URIs but the original image URIs can be inferred from a dedicated location of the Elastic Path instance. The default value is an empty string, meaning no default image URIs. |
elasticpath.default.item.thumbnail.image.uri | The URI pattern of the thumbnail image of a product item, which is used when the backend does not provide product image URIs but the thumbnail image URIs can be inferred from a dedicated location of the Elastic Path instance. The default value is an empty string, meaning no default image URIs. For example, if a product code or SKU is "12345" and this property is set to "https://elasticpath-demo-images.s3-us-west-2.amazonaws.com/your_scope_related/{itemId.code}-thumbnail.png", then the thumbnail image of the product item is set to "https://elasticpath-demo-images.s3-us-west-2.amazonaws.com/your_scope_related/12345-thumbnail.png" by default when the REST API response from the backend doesn't include the thumbnail image URI. |
You can define the properties in the Bloomreach Accelerator Configuration File 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 elasticpath.default.item.original.image.uri = elasticpath.default.item.thumbnail.image.uri = ..
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 case of anonymous Bloomreach Commerce Accelerator user, the PUBLIC role will be always used. Once customers authenticate against the Bloomreach Commerce Accelerator the underling session will be converted using the REGISTERED role: customer specific operation (e.g. cart managment, checkout) will be now available.
Connector configurations
The Bloomreach Commerce Accelerator B2C 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 module name is com.bloomreach.commercedxp.container.connector.elasticpath and matches the HST module addon name specified in the connector implementation
The Resource space property matches with Elastic Path CRISP API resource space name for the Elastic Path backend.
The table below contains all the Connector components used for the Elastic Path connector. For each component you will find a short description and all the context "variables" that will be used to perform the external request. This table refers to the Elastic Path connector implementation shipped with Bloomreach Commerce Accelerator v2.
Component ID |
Description | Context Variables |
productSearchById |
Retrieve the details of a product |
code: the product id (specified in the payload) |
productSearch | Return a list of products based on the query parameter |
page-size: the limit of your query result keywords: string query parameter |
productSearchByCategory | Like productSearch, but using categories id as filter |
resourceId: the category id specified in the backend currentPage: the page number of the paginated result PLEASE NOTE that the result is dynamically paginated in XM |
categoriesSearch | Return a list of categories | |
categoryDetailSearch |
Fetch the details of a specific category | resourceId: the category id specified in the request |
customerCreate | Register customer account in the e-commerce backend |
username: customer username, compliant to the email address format password: customer password family-name: customer family name given-name: customer given name |
authenticateCustomer | Authenticate customer against the e-commerce backend |
grant-type: type of authentication (default is password) username: customer username, compliant to the email address format password: customer password scope: e-commerce internal store (catalog) name role: customer role (REGISTERED in case of authentication) |
getCustomer | Retrieve customer profile data | |
updateCustomer | Update customer data |
resourceId: customer identifier stored in the e-commerce backend family-name: customer family name given-name: customer given name |
createCustomerAddresses | Create customer address |
Input required: street-address, extended-address, locality,postal-code, region, country-name, family-name, given-name |
updateCustomerAddresses | Set the customer address |
Input required: street-address, extended-address, locality,postal-code, region, country-name, family-name, given-name |
removeCustomerAddresses | Remove customer addresses |
resourceId: address identifier stored in the e-commerce backend |
cartProductList | Retrieve a cart object containing the status of the cart, including the related product entries | |
cartProductAdd | Add a new or existing product to the cart |
resourceId: product identifier quantity: product quantity to add |
cartProductUpdate |
Update the item quantity |
storeId: store identifier (PLEASE NOTE that this is different than the classic scope) lineItemId: id of the item to be updated quantity: new quantity of the cart item |
cartProductRemove |
Remove a product from the cart |
storeId: store identifier (PLEASE NOTE that this is different than the classic scope) lineItemId: id of the item to be updated quantity: new quantity of the cart item (fixed to 0) |
cartShipmentAddressUpdate | Update the cart shipment address |
resourceId: shipping address selector id addressId: identifier of the customer shipping address
|
cartCheckout | Retrieves the status of a cart and it's used when starting the checkout process | |
orderCreate | Place the order in the e-commerce backend, creating a new customer purchase | resourceId: order draft identifier |
orderRead | Retrieve a specifc order placed in the e-commerce backend |
resourceId: id of the purchase |
orderQuery | Retrieves the list of orders placed by a specific user |
Summary
Bloomreach Commerce Accelerator v2 provides an OOTB Elastic Path Commerce Connector Module based on the Commerce Connector SDK. The current implementation supports all the operations listed in the table above.
In case you need to customize some of the operations already shipped with this connector, you can download the connector sources and implement your own customization based on the existing implementation. For more detail, see Develop a New Commerce Connector.
When copying products from Elastic Path into brSM, a "link" needs to be created between the original product stored in the commerce backend and the related copy stored in brSM. In other words, brSM needs to store product specific data which can be used to retrieve the same product from the commerce backend.
brSM provides a standard field, called variant, in which product SKUs can be stored. In case products are copied from Elastic Path, the SKU must contain the value stored in the product code field.