Migrate to the MuleSoft HTTP Connector

The Salesforce B2C Commerce Cloud Data Connector and Salesforce B2C Commerce Cloud Shop Connector are deprecated and replaced with the MuleSoft HTTP Connector.

If you have existing Mule apps that currently use the Salesforce B2C Commerce Cloud Connectors, use the following steps as a blueprint to migrate to the MuleSoft HTTP Connector.

The Salesforce B2C Commerce Cloud Data Connector has two main elements. Both need to be migrated to the MuleSoft HTTP Connector request operation:

  • B2C Commerce Cloud Data Connector global configuration
  • Message flow containing the Salesforce B2C Commerce Cloud Data Connector operation

You must migrate the am-oauth2-configuration to the mule-oauth-module extension of the HTTP Connector.

For details, see Configure OAuth2 Client Credentials Grant Type Authentication.

  1. Make sure the HTTP Connector is a dependency in your project, for example:
  1. Add the mule-oauth-module extension to your project, for example:
  1. Create an HTTP Request configuration as a global configuration element. This is used in all flows.

    Associated screenshot

  2. For Authentication, select Client credentials grant type.

    Associated screenshot

  3. Specify Protocol and Host properties.

    Associated screenshot

  4. Configure the new http:request-config properties with the following values from your existing am-oauth2-config.

Make sure scopes contains the scope for your instance, for example: SALESFORCE_COMMERCE_API:bjms_dev.

http:request-config property nameValueCopy from am-oauth2-config
hostbaseUriYes
protocolHTTPSNo, static value
clientIdclientIdYes
clientSecretclientSecretYes
scopesscopesYes
tokenUrltokenUrlYes

The global HTTP Request Configuration with OAuth authentication is now fully configured.

Before migration:

After migration:

All commerce-cloud-dataapi operations have an organizationId, config-ref, version_ property, and various additional properties corresponding to the operation, for example, get-product has a productId:

Migrate all flows in your application using the following steps:

  1. Copy your existing flow.
  2. In the copy of the flow, remove the commerce-cloud-dataapi operation.
  3. Add the http operation to the corresponding place in the flow.
  4. In the Mule Palette view, select HTTP > Request.
  5. Drag Request to the Studio canvas and the flow.
  6. Select the plus sign (+) next to the Connector configuration field to configure the previously created global HTTP Request Configuration with OAuth authentication, as shown in the following example. For details, see: Migrate to global configuration using mule-oauth-module extension.
  1. Configure the new http properties with the following values from your existing commerce-cloud-dataapi operation. You can get API details for your operation from SCAPI Reference documentation, for example: getProduct.

Associated screenshot

  1. Copy the method and path with placeholders from the applicable documentation, for example: /product/products/v1/organizations/{organizationId}/products/{productId}.

  2. Add URI parameter, query parameter, body, and header to the HTTP Connector request operation.

http:request property nameValue
config-refHTTP_Request_configurationSee: Migrate to global configuration using mule-oauth-module extension for the previously created http:request-config property name.
methodCopy operation from SCAPI documentation **** (GET)SCAPI documentation
pathCopy path with placeholder from SCAPI documentationSCAPI documentation
base URI parameter {organizationId}commerce-cloud-dataapi : organizationIdCopy from commerce-cloud-dataapi operation property organizationId.
additional URI parameterSCAPI documentation, if applicable
Query parameterSCAPI documentation, if applicable
BodySCAPI documentation, if applicable
HeaderSCAPI documentation, if applicable

For details, see the following documentation:

Associated screenshot

  1. If required, add additional configuration according to HTTP Connector capabilities:
Commerce Cloud Data ConnectorHTTP Connector
  • Listener
  • Get Product (Commerce Cloud Data Connector operation)
  • Listener
  • Get Product (HTTP Connector Request operation)
Associated screenshotAssociated screenshot

Before migration:

After migration:

You must migrate all elements of the Salesforce B2C Commerce Cloud Shop Connector to the MuleSoft HTTP Connector request operation.

The Salesforce B2C Commerce Cloud Shop Connector uses a deprecated auth call, which is no longer supported. For details, see B2C Commerce API Release Notes and Authorization for Shopper APIs.

You must migrate the shopper-token-config objects shopper-token-connection and customer-auth-config to the HTTP Connector.

Associated screenshot

  1. Make sure the HTTP Connector is a dependency in your project, for example:
  1. Create an HTTP Request Configuration as a global configuration element to be used in all flows.

Associated screenshot

Although the mule-oauth-module allows client-credentials-grant-type, the configuration does not allow additional parameters that SCAPI requires. Therefore, an additional HTTP Connector Configuration for OAuth is used. For details, see: https://docs.mulesoft.com/http-connector/1.5/http-authentication#oauth2cc.

  1. Configure the new http:request-config properties with the following values from your existing shopper-token-connection and customer-auth-config:
http:request-config property nameValueCopy from shopper-token-connection and customer-auth-config?
hostbaseUriYes
protocolHTTPSNo, static value
clientIdclientIdYes
clientSecretclientSecretYes

Associated screenshot Associated screenshot

All commerce-cloud-shopper-api operations have an organizationId, config-ref, siteId, version_ property and various additional properties corresponding to the operation, for example: get-product has a productId.

Migrate these in a manner similar using the previous steps, for example:

For a registered shopper, there might be similar flow operation objects containing authorization and authentication, for example:

Commerce Cloud Shop ConnectorHTTP Connector
  • Listener
  • Get Access token (for guest/unregistered customer) (Commerce Cloud Shop Connector operation)
  • Set variable for jwt-token
  • Logger (optional)
  • Get Product (Commerce Cloud Shop Connector operation)
  • Listener
  • Get Access token (for guest/unregistered customer) (Commerce Cloud Shop Connector operation)
  • Set variable for jwt-token
  • Logger (optional)
  • Get Product (HTTP Connector request operation)
Associated screenshotAssociated screenshot

Migrate all flows in your application to a flow utilizing the HTTP Connector:

  1. Copy your existing flow.
  2. In the copy of the flow, remove the commerce-cloud-dataapi operation.
  3. Add the http:request operation to the corresponding place in the flow.
  4. In the Mule Palette view, select HTTP > Request.
  5. Drag Request to the Studio canvas and the flow.
  6. Click the plus sign (+) next to the Connector configuration field to configure the previously created global HTTP Request Configuration. For details, see: Global configuration containing the Shop_Connector_Customer_auth_config and Shop_Connector_Shopper_token_config.
  7. Configure the new http properties with the following values from your existing commerce-cloud-shopapi operation.

Associated screenshot Associated screenshot

  1. Get API details for your operation from the SCAPI documentation, for example:

Associated screenshot

Associated screenshot

  1. Copy the method and path with placeholders from the applicable documentation, for example:
  • /shopper/auth/v1/organizations/{organizationId}/oauth2/token
  • /product/products/v1/organizations/{organizationId}/products/{productId}
  1. Add URI parameter, query parameter, body and header to the HTTP Connector request operation.

Associated screenshot

For Get Access token (HTTP Connector request operation)

http:request property nameValueNotes
config-refHTTP_Request_Auth_configurationSee the previously created http:request-config property name, which contains the Basic credentials for Basic auth.
methodCopy operation from SCAPI documentation (GET)SCAPI documentation
pathCopy path with placeholder from SCAPI documentationSCAPI documentation
base URI parameter {organizationId}commerce-cloud-shopapi : organizationIdCopy from commerce-cloud-shopapi operation property organizationId.
additional URI parameterSCAPI documentation, if applicable
Query parametercommerce-cloud-shopper-api:custom-query-params "grant_type" : "client_credentials", "channel_id" : "SiteGenesis"SCAPI documentation, if applicable
BodySCAPI documentation, if applicable
Headercommerce-cloud-shopper-api:custom-headers "Content-Type":"application/x-www-form-urlencoded"SCAPI documentation, if applicable

For Get Product (HTTP Connector request operation)

http:request property nameValueNotes
config-refHTTP_Request_configurationSee the previously created http:request-config property name.
methodCopy operation from SCAPI documentation (GET)SCAPI documentation
pathCopy path with placeholder from SCAPI documentationSCAPI documentation
base URI parameter {organizationId}commerce-cloud-shopapi : organizationIdCopy from commerce-cloud-shopapi operation property organizationId.
additional URI parametercommerce-cloud-shopper-api:get-product-shopper-products-organizations-products-by-version-organization-id-id → idSCAPI documentation, if applicable
Query parametercommerce-cloud-shopper-api:get-product-shopper-products-organizations-products-by-version-organization-id-id → siteIdSCAPI documentation, if applicable
BodySCAPI documentation, if applicable
HeaderSCAPI documentation, if applicable

For additional details, see the following documentation:

  1. If required, add additional configuration according to HTTP Connector capabilities. For details, see the following documentation:

Before migration:

After migration: