commercetools Connector Configuration - Bloomreach Experience - Headless Digital Experience Platform

commercetools Connector Configuration

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 (* required field) 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"
}
'<EMAIL_SERVICE_ENDPOINT>'  

.

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?