Salesforce Commerce Cloud (SFCC) is an e-commerce solution for B2C (business to consumer) and B2B (business to business) customers. This connector helps to
- Synchronize customer profiles on TD Console to the Customer Lists on the SFCC platform.
- Assign customers to or remove customers from the static Customer Groups on the SFCC platform.
- Basic Knowledge of Treasure Data
- Basic knowledge of Salesforce Commerce Cloud
- Basic knowledge of Open Commerce Cloud API
- Have an API Client created on the Commerce Cloud Account Manager System. Further details can be found here
- The application secret should not contain the
%character. Due to an internal issue with the SFCC authentication server, any secret containing the% character is not able to authenticate. - The connector will send the customer attributes as-is without validating them. Data validation is on the SFCC side.
- To synchronize customer profiles to the SFCC Customer List, the list must exist on SFCC before the job execution.
- A large volume of data may cause low performance.
You must create and configure the data connection on TD Console before running your query. As part of the data connection, you provide authentication to access the integration following the below steps

- Open TD Console
- Navigate to Integrations Hub > Catalog
- Search for and select Salesforce Commerce Cloud
- Select Create Authentication, and provide the credential information for the integration as described below
- Select **Continue,**enter a name for the Authentication, and select Done.
| Field | Description |
|---|---|
| API Client ID | The API Client ID is generated by following the Create and configure an API Client procedure |
| API Client Password | The password of the API Client |
| Base URI | URL for accessing your Business Manager Application. Example value: https://xxxx.commercecloud.salesforce.com/ |
The TD Console supports multiple ways to export data. Please follow the below steps to export data from the Data Workbench.
- Navigate to Data Workbench > Queries.
- Select New Query, and define your query.
- Select Export Results to configure the data exporting.
- Select an existing SFCC authentication or create a new one following the above section.
- Configure the exporting parameters as described below, and select Done.
- Configuration Parameters
| Field | Description |
|---|---|
| Data target |
|
| Operation mode | With the Customer List data target, select one of the supported operating modes that follow:
|
| Customer list ID | Required in case of the Customer List data target. The ID of a predefined Customer List needs to be provided. Otherwise, the query result must include a column named customer_list_id. |
| Skip empty/null fields | (Applied only for the Customer List data target) When unchecked, empty, or null, attributes (columns) will be sent to SFCC. Consequently, those attributes on SFCC will be cleared (be overwritten by an empty value). The default is checked, in which attributes that are empty or null will not be sent to SFCC. |
| Site ID | Required in case of the Customer Group data target. The ID of the site the target Customer Group belongs. |
| Customer group ID | Required in case of the Customer Group data target. The ID of a static Customer Group. If not exist, a new one will be created |
| Customer group name | (Optional. Applied only for the Customer Group data target.) The group name will be used in case the specified Customer Group doesn't exist. |
| Thread count | The number of concurrent upload jobs ranges from 2 to 40. |
Customer attribute overwriting of the Customer List data target
- Use Update mode to update some selected attributes of the existing customer profiles. If
Skip empty/null fieldsis checked, empty or null attributes will not be exported, and the existing values on SFCC will stay unchanged. - Use Upsert mode when you want to overwrite all attributes. This means that the existing customer profiles will be replaced by those included in the query result, and attributes that are not included will be emptied. Profiles that do not exist will be created anew. |
- Your query must include the customer_no column to indicate which customer profiles are synchronized.
- If the query intention is to update multiple Customer Lists, a column named customer_list_id can be included to indicate the target lists
- For other customer attributes, please refer to the SFCC documentation. All attributes will be sent as-is without any validation
| Column | Description | Mandatory |
|---|---|---|
| customer_list_id | If it is not empty/null, it defines the ID of the Customer List, where the customer attributes on the row will be updated. Otherwise, the Customer List filled in the Configuration screen will be taken into account. | Optional |
| customer_no | SFCC Customer Number. it is not required in the Create mode. | Required |
| Credentials | Credential information is required in the Create mode. Please refer here for more details. | Optional |
| Customer attributes | Refer here for the list of supported attributes. | Optional |
| Customer address | Refer here for the list of supported attributes. | Optional |
To assign (or remove) customers to (from) a Customer Group, the only required column in your query is the customer_no column.
You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.
Treasure Data's scheduler feature supports periodic query execution to achieve high availability.
When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored.
For example, if the cron schedule is '0 0 1 * 1', then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed.
Navigate to Data Workbench > Queries
Create a new query or select an existing query.
Next to Schedule, select None.

In the drop-down, select one of the following schedule options:

Drop-down Value Description Custom cron... Review Custom cron... details. @daily (midnight) Run once a day at midnight (00:00 am) in the specified time zone. @hourly (:00) Run every hour at 00 minutes. None No schedule.

| Cron Value | Description |
|---|---|
0 * * * * | Run once an hour. |
0 0 * * * | Run once a day at midnight. |
0 0 1 * * | Run once a month at midnight on the morning of the first day of the month. |
| "" | Create a job that has no scheduled run time. |
* * * * *
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +---------- month (1 - 12)
| | +--------------- day of month (1 - 31)
| +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)The following named entries can be used:
- Day of Week: sun, mon, tue, wed, thu, fri, sat.
- Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.
A single space is required between each field. The values for each field can be composed of:
| Field Value | Example | Example Description |
|---|---|---|
| A single value, within the limits displayed above for each field. | ||
A wildcard '*' to indicate no restriction based on the field. | '0 0 1 * *' | Configures the schedule to run at midnight (00:00) on the first day of each month. |
A range '2-5', indicating the range of accepted values for the field. | '0 0 1-10 * *' | Configures the schedule to run at midnight (00:00) on the first 10 days of each month. |
A list of comma-separated values '2,3,4,5', indicating the list of accepted values for the field. | 0 0 1,11,21 * *' | Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month. |
A periodicity indicator '*/5' to express how often based on the field's valid range of values a schedule is allowed to run. | '30 */2 1 * *' | Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. '0 0 */5 * *' configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month. |
A comma-separated list of any of the above except the '*' wildcard is also supported '2,*/5,8-10'. | '0 0 5,*/10,25 * *' | Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month. |
- (Optional) You can delay the start time of a query by enabling the Delay execution.
Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination.
Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.
(Optional) You can delay the start time of a query by enabling the Delay execution.
You can also send segment data to the target platform by creating an activation in the Audience Studio.
- Navigate to Audience Studio.
- Select a parent segment.
- Open the target segment, right-mouse click, and then select Create Activation.
- In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
- Customize the activation output in the Output Mapping panel.

- Attribute Columns
- Select Export All Columns to export all columns without making any changes.
- Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
- String Builder
- + Add string to create strings for export. Select from the following values:
- String: Choose any value; use text to create a custom value.
- Timestamp: The date and time of the export.
- Segment Id: The segment ID number.
- Segment Name: The segment name.
- Audience Id: The parent segment number.
- + Add string to create strings for export. Select from the following values:
- Set a Schedule.

- Select the values to define your schedule and optionally include email notifications.
- Select Create.
If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.
The TD Toolbelt can trigger the Query Result exporting from a CLI. You need to specify the parameters for the exporting job as the --result option of the td query command. For more information, please refer to this article.
The format of the option is JSON and the general structure is as follows.
- Case: data_target is customer_list
{"type": "salesforce_commerce_cloud", "client_id": "client_id", "client_secret": "client_secret", "base_url": "https://your link.commercecloud.salesforce.com", "data_target": "customer_list", "operation_mode": "create,update,delete,upsert", "customer_list_id": "customer_list_id", "skip_empty_fields": true, "thread_count": 2}Case: data_target is customer_group{ "type": "salesforce_commerce_cloud", "client_id": "client_id", "client_secret": "client_secret", "base_url": "https://your link.commercecloud.salesforce.com", "data_target": "customer_list", "customer_group_operation_mode": "add,remove,replace", "site_id": "your site id", "customer_group_id": "your customer group id", "customer_group_name": "your customer group name", "thread_count": 2}| Name | Description | Value | Default Value | Required |
|---|---|---|---|---|
| data_target | Ref data_target in Configuration Parameters section | List of options:
| customer_group | YES |
| td_authentication_id | This is the id of the exsiting SFCC authentication on TD console. PS: when using td_authentication_id, we don't need to declare the client_id & client_secret. Because TD system will get those info by td_authentication_id | Number | null | NO |
| client_id | The client_id that get from SFCC. PS: TD system will ignore this value when td_authentication_id is null. | String | null | YES (when td_authentication_id is null) |
| client_secret | The client_secret that get from SFCC. PS: TD system will ignore this value when td_authentication_id is null. | String | null | YES (when td_authentication_id is null) |
| base_url | Ref base_url in Configuration Parameters section | String | null | YES |
| operation_mode | Ref operation_mode in Configuration Parameters section. The operation_mode only use when the data_target is customer_list. | Options:
| customer_list | YES (when data_target is customer_list) |
| customer_list_id | Ref customer_list_id in Configuration Parameters section. The operation_mode only use when the data_target is customer_list. | String | null | YES (when data_target is customer_list) |
| skip_empty_fields | The indicator flag that help the connector decide to ignore the fields that have value are empty or null. | Boolean | true | NO |
| customer_group_operation_mode | The operation_mode only use when the data_target is customer_group. Which action will be apply for customer_group. | Options:
| Add | YES (when data_target is customer_group) |
| site_id | Ref site_id in Configuration Parameters section. | String | null | YES (when data_target is customer_group) |
| customer_group_id | Ref customer_group_id in Configuration Parameters section. | String | null | YES (when data_target is customer_group) |
| customer_group_name | Ref customer_group_name in Configuration Parameters section. | String | empty | NO |
- Create the new customer
td --database luan_db --wait "SELECT customer_list_id,first_name,last_name,birthday,company_name,email,fax,gender,job_title,phone_business,phone_home,phone_mobile,second_name,credentials FROM (VALUES ('site_1','fname_201','lname_1','1990-05-12','Test Company','test201@test.com','84111111201',1,'Sr Software','84111111201','84111111201','84111111201','Ryan','{\"enabled\":true,\"locked\":false,\"login\":\"login_url_1_100001.csv\"}')) tbl(customer_list_id,first_name,last_name,birthday,company_name,email,fax,gender,job_title,phone_business,phone_home,phone_mobile,second_name,credentials)" \--type presto \--result '{"type":"salesforce_commerce_cloud","td_authentication_id": 2837,"base_url":"https://zzvt-003.dx.commercecloud.salesforce.com","operation_mode":"create","customer_list_id":"static_g_1","skip_invalid_record":true,"thread_count":2}'- Update the existing customer
td --database luan_db --wait "SELECT customer_list_id,customer_no,first_name,last_name,credentials FROM (VALUES ('site_1','00000001','fname_1_updated','','{\"enabled\":true,\"locked\":false,\"login\":\"login_url_1_100001.csv\"}')) tbl(customer_list_id,customer_no,first_name,last_name,credentials)" \--type presto \--result '{"type":"salesforce_commerce_cloud","data_target": "customer_list","td_authentication_id": 2837,"base_url":"https://zzvt-003.dx.commercecloud.salesforce.com","operation_mode":"update","customer_list_id":"static_g_1","skip_invalid_record":true,"thread_count":2}'- Assign customer to a specific customer group
td --database luan_db --wait "SELECT customer_no FROM (VALUES ('00000001')) tbl(customer_no)" \--type presto \--result '{"type":"salesforce_commerce_cloud","data_target": "customer_group","td_authentication_id": 2837,"base_url":"https://zzvt-003.dx.commercecloud.salesforce.com","customer_group_operation_mode":"add","site_id":"site_1", "customer_group_id": "static_customer_group_1","thread_count":2}'This section explains at a high level how to obtain credentials and configure necessary permissions (if any) to use the SFCC API. The detailed steps might be changed by Salesforce without any in-advance notice.
- Navigate and log in to the SFCC Account Manager
- Select API Client

- Select Add API Client

- Type values for Display Name, Password, Confirm Password, and select Access Control to enable it
- In the Organizations area, select your organization
- In the Roles area, select Add
- Select the appropriate roles, and select Add
- Scroll to the Token Endpoint Auth Method section
- Select the Auth method and the token format like the one below, and select Save

- Note down the API Client ID and Password to create a new Authentication for the SFCC integration on the TD Console
These steps allow the created API Client to modify data on your SFCC instance using the Open Commerce API features
- Open Business Manager (https://{YOUR_INSTANCE_URL}.commercecloud.salesforce.com/on/demandware.store/Sites-Site/default/ViewApplication-DisplayWelcomePage)
- Select Administration >> Open Commerce API Settings

- Select Data in the Select Type drop-down list

- On the configuration string of the Data API, make sure the WRITE permission is set: "write_attributes": "(**)"
- Select Global (organization-wide) in the Select Context drop-down list
- Select Save, and the permission of the API Client will be applied in a few minutes
Your API Client is ready to be used in the Salesforce Commerce Cloud integration
The Result Export can be scheduled to upload data to a target destination periodically
All import and export integrations can be added to a TD Workflow. The td data operator can be used to export a query result to a specified connector. For more information, see Reference for Treasure Data Operators