commercetools Connector Configuration

This Bloomreach Experience Manager feature requires a standard or premium license. Please contact Bloomreach for more information.

Introduction

As explained in Configure brX GraphQL Service, the .env file contains the connection settings to integrate with commercetools.

Configuration Options

The following options are supported:

Property Name Description Example Value(s) Default Value
COMMERCETOOLS_API_BASE_URL The URL of the commercetools HTTP API host. 'https://api.sphere.io'  
COMMERCETOOLS_AUTH_BASE_URL The URL of the commercetools OAuth2 server. 'https://auth.sphere.io'  
COMMERCETOOLS_PROJECT_KEY Your commercetools project key. 'myproject'  
COMMERCETOOLS_CLIENT_ID The OAuth2 client ID used in requests to the commercetools platform. 'myApollo'  
COMMERCETOOLS_CLIENT_SECRET The OAuth2 client secret used in requests to the commercetools platform. 'changeIt'  
COMMERCETOOLS_SCOPE

The OAuth2 scope(s) used in requests to the commercetools.

This value is a combination of multiple scopes for various features of the commercetools. The commercetools endpoints may provide various scopes to grants API access within a project. See commercetools HTTP API and related API documentation for detail.

'view_categories:myproject create_anonymous_token:myproject manage_my_shopping_lists:myproject view_published_products:myproject manage_my_profile:myproject manage_my_orders:myproject manage_my_payments:myproject'  
COMMERCETOOLS_CUSTOM_ATTR_FIELDS

If a list of field names is specified as a comma separated string, then extra custom fields are extracted from the product item in the JSON response and included in the the GraphQL response like the following example:

{
  "data": {
    "findItemsByKeyword": {
      //...
      "items": [
        {
          //...
          "customAttrs": [
            { "name": "hasStagedChanges", "values": [ "false" ] },
            { "name": "lastModifiedAt", "values": [ "2018-01-29T20:20:50.328Z" ] },
            { "name": "slug", "values": [ "{\"en\":\"thanksgiving-activity-book-1476365028138\"}" ] }
          ]
        },
        //...
      ]
    }
  }
}
'hasStagedChanges,lastModifiedAt,slug'  
EMAIL_API_URL

The URL of the trusted email service.

In the case of customer's password reset, commercetools does not automatically send the password reset email. However, the brX GraphQL Service is able to retrieve to customer reset token and send it  - together with the customer details - to the trusted email service. 

The email service implementation (e.g. REST service) must be able to process the request triggered by the brX GraphQL Service. The request body has the following structure:

{
  "customer": {
    "email": "...",
    "firstName": "...",
    "middleName": "...",
    "lastName": "...",
    "title": "...",
    "salutation": "...",
    "locale": "..."
  },
  "token": "XXX"
}
'https://<brXM_instance>/site/restservices/sendEmail'  
COMMERCETOOLS_AVAILABLE_LOCALES A comma-separated string to specify which languages are available in the commercetools instance. After reading the client's locale preferences (e.g, Accept-Language HTTP Request header or locale parameter during the sign-in request), the best locale is chosen for the client from the available languages supported by the commercetools instance. 'en,de'  

.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?