commercetools Configurations
Info: This feature in Bloomreach Content requires a standard or premium license. Contact Bloomreach for details.
Overview
You can integrate Bloomreach Content with commercetools using the Bloomreach Commerce Accelerator. The B2C application includes all necessary configurations to connect to your commercetools instance.
This page covers:
- Connecting to your commercetools instance
- An overview of commercetools connector configurations
Connecting to a commercetools Instance
commercetools is a cloud-based commerce API solution. The Bloomreach Commerce Accelerator B2C application provides a CRISP resource for connecting to your commercetools instance. Configuration is located at:
/hippo:configuration/hippo:modules/crispregistry/hippo:moduleconfig/crisp:resourceresolvercontainer/commercetools
You must set the following connection properties:
| Property name | Description |
|---|---|
commercetools.baseUrl | The base URL of your commercetools instance (e.g., https://api.<region>.<cloudProvider>.commercetools.com/<project_name>).See commercetools hosts documentation for details. |
commercetools.accessTokenUri | The URI to obtain your access token using the credentials flow (e.g., https://auth.<region>.<cloudProvider>.commercetools.com/oauth/token?grant_type=client_credentials&scope=manage_project:<project_name>).See commercetools authorization documentation for details. |
commercetools.clientId | OAuth 2 client ID generated for your project. |
commercetools.clientSecret | OAuth 2 client secret generated for your project. |
You can configure these API client credentials in your commercetools project at: https://mc.commercetools.com/<project_name>/settings/developer/api-clients.
Define these properties in the Bloomreach Accelerator Configuration File as shown below. Replace placeholders with your project-specific values:
..
commercetools.baseUrl = https://api.<region>.<cloudProvider>.commercetools.com/<project_name>/
commercetools.accessTokenUri = https://auth.<region>.<cloudProvider>.commercetools.com/oauth/token?grant_type=client_credentials&scope=manage_project:<project_name>
commercetools.clientId = <client_id>
commercetools.clientSecret = <client_secret>
..
Connector Configurations
The Bloomreach Commerce Accelerator B2C application includes a commerce connector definition for commercetools. You can find this in the Default Commerce Connector Set document, under the commerce-connectors folder, with the Connector ID set to commercetools.
This connector is linked by name to a specific mapping bundle document. For commercetools, the resource bundle document ID is starterstore.mapping.commercetools. This document is located in the mappings folder under administration.
The Resource space property must match the commercetools CRISP resource name.
The table below lists all connector components for the commercetools connector. Each entry includes a description and the context variables resolved at runtime for external requests.
| Component ID | Description | Context Variables |
|---|---|---|
productDetail | Retrieves product details | externalReferenceId: Product ID specified in the URL |
productList | Retrieves a list of products | |
facetList | Returns products filtered by facet | locale: Search locale for multi-language supportstarterstoreQueryParam_query: Query string parameterFacet values can be customized in the configuration |
productSearch | Returns products based on query parameters | starterstoreQueryParam_pageSize: Query result limitstarterstoreQueryParam_offset: Query result offsetlocale: Search localestarterstoreQueryParam_query: Query string parameterstarterstoreQueryParam_facetQuery: Filter by facet valuescategories: Filter by category ID |
productSearchByCategory | Same as productSearch, but filters by category | externalReferenceId: Category IDstarterstoreQueryParam_pageSize: Query result limitstarterstoreQueryParam_offset: Query result offsetlocale: Search localestarterstoreQueryParam_query: Query string parameterstarterstoreQueryParam_facetQuery: Filter by facet values |
categoriesList | Returns a list of categories | |
categoryDetail | Fetches details of a specific category | externalReferenceId: Category ID specified in the request |
categorydecorator | Used by the category decorator document type, specifically by the external document picker plugin | |
productdecorator | Used by the product decorator document type, specifically by the external document picker plugin | starterstoreQueryParam_query: Query string parameter in the modal windowid: If specified, displays only the product with that ID |
createCustomer | Creates a new customer | anonymousCartId: Anonymous cart ID associated before registrationcustomer: Customer object with user data |
getCustomer | Retrieves customer data | storeUser: Bloomreach Commerce Accelerator user object |
updateCustomer | Updates customer data | customer: Customer object with e-commerce user data |
deleteCustomer | Deletes customer from the back end | |
cartCreate | Creates a cart | cartCurrency: Cart currency for multi-currency supportcountry: Used to determine product availability by region/countrystoreUser: Bloomreach Commerce Accelerator user object |
cartDelete | Deletes a cart | cartId |
cartProductList | Retrieves a cart object with cart status and assigned products | cartId |
cartProductAdd | Adds a new or existing product to the cart | cartVersion: Cart revisioncartProductId: Product ID |
cartProductUpdate | Updates item quantity in the cart | cartVersion: Cart revisioncartItemId: Item ID to updatecartItemQuantity: New quantity |
cartProductRemove | Removes a product from the cart | cartVersion: Cart revisioncartItemId: Item ID to remove |
cartCustomerUpdate | Updates the cart owner | cartVersion: Cart revisionstoreUser: Bloomreach Commerce Accelerator user |
authenticateCustomer | Authenticates user against commercetools | anonymousCartId: Anonymous cart ID before authenticationcustomer: Customer object with user data |
orderQuery | Retrieves orders for a specific user | storeUser: Bloomreach Commerce Accelerator user object |
changeCustomerPassword | Changes customer password | customerInBackend: Customer object with latest revisioncustomer: Customer object with new user data |
updateCustomerAddresses | Updates customer addresses | customerInBackend: Customer object with latest revisioncustomer: Customer object with new user data |
updateCustomerDefaultAddresses | Sets customer default address | customerInBackend: Customer object with latest revisioncustomer: Customer object with new user data |
removeCustomerAddresses | Removes customer addresses | customerInBackend: Customer object with latest revisioncustomer: Customer object with new user data |
paymentCreate | Creates a payment entry in commercetools | cartIdcartCurrency: For multi-currency sitescartAmount: Total cart amount |
orderCreate | Creates an order in the commerce backend | cartVersion: Cart revisioncartId |
cartShipmentMethodUpdate | Updates the cart shipment method | cartIdcartVersion: Cart revisionshippingMethodReference: Internal reference to the shipment method |
cartShipmentAddressUpdate | Updates the cart shipment address | cartIdcartVersion: Cart revisionaddress: Address object defined in Bloomreach Commerce Accelerator |
Info: When copying products from commercetools into brSM, you must create a link between the original product in the commerce backend and the corresponding copy in brSM. brSM uses a standard field called
variantto store product SKUs. If you copy products from commercetools, the SKU must match the value in the product key field.