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.
- Make sure the HTTP Connector is a dependency in your project, for example:
- Add the mule-oauth-module extension to your project, for example:
-
Create an HTTP Request configuration as a global configuration element. This is used in all flows.
-
For Authentication, select Client credentials grant type.
-
Specify Protocol and Host properties.
-
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 name | Value | Copy from am-oauth2-config |
---|---|---|
host | baseUri | Yes |
protocol | HTTPS | No, static value |
clientId | clientId | Yes |
clientSecret | clientSecret | Yes |
scopes | scopes | Yes |
tokenUrl | tokenUrl | Yes |
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:
- Copy your existing flow.
- In the copy of the flow, remove the commerce-cloud-dataapi operation.
- Add the http
operation to the corresponding place in the flow. - In the Mule Palette view, select HTTP > Request.
- Drag Request to the Studio canvas and the flow.
- 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.
- 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.
-
Copy the method and path with placeholders from the applicable documentation, for example:
/product/products/v1/organizations/{organizationId}/products/{productId}
. -
Add URI parameter, query parameter, body, and header to the HTTP Connector request operation.
http:request property name | Value | |
---|---|---|
config-ref | HTTP_Request_configuration | See: Migrate to global configuration using mule-oauth-module extension for the previously created http:request-config property name. |
method | Copy operation from SCAPI documentation **** (GET) | SCAPI documentation |
path | Copy path with placeholder from SCAPI documentation | SCAPI documentation |
base URI parameter {organizationId} | commerce-cloud-dataapi : organizationId | Copy from commerce-cloud-dataapi operation property organizationId . |
additional URI parameter | SCAPI documentation, if applicable | |
Query parameter | SCAPI documentation, if applicable | |
Body | SCAPI documentation, if applicable | |
Header | SCAPI documentation, if applicable |
For details, see the following documentation:
- If required, add additional configuration according to HTTP Connector capabilities:
- Configure HTTP Request Operation
- HTTP Request Attributes Reference
- Mule 4 Thread Pools and Tuning apps
Commerce Cloud Data Connector | HTTP Connector |
---|---|
|
|
![]() | ![]() |
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.
- Make sure the HTTP Connector is a dependency in your project, for example:
- Create an HTTP Request Configuration as a global configuration element to be used in all flows.
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.
- Configure the new
http:request-config
properties with the following values from your existingshopper-token-connection
andcustomer-auth-config
:
http:request-config property name | Value | Copy from shopper-token-connection and customer-auth-config ? |
---|---|---|
host | baseUri | Yes |
protocol | HTTPS | No, static value |
clientId | clientId | Yes |
clientSecret | clientSecret | Yes |
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 Connector | HTTP Connector |
---|---|
|
|
![]() | ![]() |
Migrate all flows in your application to a flow utilizing the HTTP Connector:
- Copy your existing flow.
- In the copy of the flow, remove the
commerce-cloud-dataapi
operation. - Add the
http:request
operation to the corresponding place in the flow. - In the Mule Palette view, select HTTP > Request.
- Drag Request to the Studio canvas and the flow.
- 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.
- Configure the new http
properties with the following values from your existing commerce-cloud-shopapi operation.
- Get API details for your operation from the SCAPI documentation, for example:
- 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}
- Add URI parameter, query parameter, body and header to the HTTP Connector request operation.
For Get Access token (HTTP Connector request operation)
http:request property name | Value | Notes |
---|---|---|
config-ref | HTTP_Request_Auth_configuration | See the previously created http:request-config property name, which contains the Basic credentials for Basic auth. |
method | Copy operation from SCAPI documentation (GET) | SCAPI documentation |
path | Copy path with placeholder from SCAPI documentation | SCAPI documentation |
base URI parameter {organizationId} | commerce-cloud-shopapi : organizationId | Copy from commerce-cloud-shopapi operation property organizationId . |
additional URI parameter | SCAPI documentation, if applicable | |
Query parameter | commerce-cloud-shopper-api:custom-query-params "grant_type" : "client_credentials", "channel_id" : "SiteGenesis" | SCAPI documentation, if applicable |
Body | SCAPI documentation, if applicable | |
Header | commerce-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 name | Value | Notes |
---|---|---|
config-ref | HTTP_Request_configuration | See the previously created http:request-config property name. |
method | Copy operation from SCAPI documentation (GET) | SCAPI documentation |
path | Copy path with placeholder from SCAPI documentation | SCAPI documentation |
base URI parameter {organizationId} | commerce-cloud-shopapi : organizationId | Copy from commerce-cloud-shopapi operation property organizationId . |
additional URI parameter | commerce-cloud-shopper-api:get-product-shopper-products-organizations-products-by-version-organization-id-id → id | SCAPI documentation, if applicable |
Query parameter | commerce-cloud-shopper-api:get-product-shopper-products-organizations-products-by-version-organization-id-id → siteId | SCAPI documentation, if applicable |
Body | SCAPI documentation, if applicable | |
Header | SCAPI documentation, if applicable |
For additional details, see the following documentation:
- If required, add additional configuration according to HTTP Connector capabilities. For details, see the following documentation:
- Configure HTTP Request Operation
- HTTP Request Attributes Reference
- Mule 4 Thread Pools and Tuning apps
Before migration:
After migration: