Salesforce Commerce Cloud Setup Guide
Prerequisites
-
An Administrator user in Salesforce Commerce Cloud.
-
Your account must be able to use these Admin API authorization scopes:
sfcc.catalogssfcc.customerlistssfcc.gift-certificatessfcc.orderssfcc.productssfcc.promotionssfcc.source-codes
-
For OCAPI tables only: a second API client. Open Commerce API (OCAPI) calls reject a client ID created for the Salesforce Commerce API (SCAPI), so each API gets its own client.
Setup Guide
-
Step 1: Create a Salesforce Commerce API client
-
Log in to your Salesforce Commerce Cloud account.
-
Open API Client from the left-hand menu.
-
Click Add API Client.
-
Give the client a Display Name.
-
Choose a password and type it in Password and Confirm Password. Keep a copy: this password is the client secret.
-
Under Organizations, click Add, pick the organizations this client should cover, and click Add to confirm.
-
Under Roles:
- Click Add.
- Choose the Salesforce Commerce API category.
- Click Add.
- Click the filter button, then pick the organization to show its instances.
- Search for each instance the client should reach, select them all, and click Add.
-
Paste the scopes from the Prerequisites section into Allowed Scopes, one per line.
-
Set Token Endpoint Auth Method to client_secret_post.
-
Set Access Token Format to JWT.
-
Click Save.
-
Copy the API Client ID that appears. In Step 5 it goes into Client ID, and the password into Client Secret.
-
-
Step 2: Find your organization ID and short code
- Under Administration > Site Development, open Salesforce Commerce API Settings.
- Copy the Organization ID and Short Code from this page. In Step 5 they go into the fields of the same name.
-
Step 3: Find your site ID
- Under Administration > Sites, open Manage Sites.
- Copy the Site ID from this page. In Step 5 it goes into Site ID.
-
Step 4: Find your customer list ID
- Under Administration > Sites, open Customer Lists.
- Copy the Customer List ID from this page. In Step 5 it goes into Customer List ID.
-
(Optional) Create an Open Commerce API client
Skip this section unless you want to sync OCAPI tables. Create a new client here, because the one from Step 1 won't work for OCAPI.
- Open API Client from the left-hand menu.
- Click Add API Client.
- Give the client a Display Name.
- Choose a password and type it in Password and Confirm Password. Keep a copy: this password is the OCAPI client secret.
- Under Organizations, click Add, pick the organizations this client should cover, and click Add to confirm.
- Skip the Roles section.
- Set Token Endpoint Auth Method to client_secret_post.
- Set Access Token Format to JWT.
- Click Save.
- Copy the API Client ID that appears. In Step 5 it goes into OCAPI Client ID, and the password into OCAPI Client Secret.
-
(Optional) Add permissions for OCAPI endpoints
- Under Administration > Site Development, open Open Commerce API Settings.
- Set Select Type to Data.
- Set Select Context to Global.
- Paste the permissions code below into the editor. Entries for tables you won't sync can be left out. Each table you sync needs its resource_id, methods, and attributes.
{
"_v": "23.0",
"clients": [
{
"client_id": "<OCAPI Client ID>",
"resources": [
{
"resource_id": "/sites/*/customer_group_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/custom_objects_search/*",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/custom_object_definitions/*/attribute_definition_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/custom_object_definitions/*/attribute_group_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/sites/*/stores",
"methods": [
"get"
],
"read_attributes": "(**)"
},
{
"resource_id": "/inventory_lists",
"methods": [
"get"
],
"read_attributes": "(**)"
},
{
"resource_id": "/inventory_lists/*/product_inventory_records",
"methods": [
"get"
],
"read_attributes": "(**)"
},
{
"resource_id": "/catalogs/*/shared_product_options",
"methods": [
"get"
],
"read_attributes": "(**)"
}
]
}
]
}
-
(Optional) Find your OCAPI hostname
- Under Administration > Sites, open Manage Sites.
- Open Manage Business Manager site.
- Copy the Hostname from the Hostnames tab. Step 5 asks for it as the OCAPI Hostname.
-
(Optional) Find your custom object types
- Under Administration > Site Development, open Custom Object Types.
- Step 5 takes custom object type names as a comma-separated list, so copy the ones Matia should sync.
-
Step 5: Connect Salesforce Commerce Cloud in Matia
- Type in the Client ID and Client Secret of the API client from Step 1.
- For Organization ID and Short Code, use the values from Step 2.
- For Site ID, use the value from Step 3.
- For Customer List ID, use the value from Step 4.
- (Optional) If you created the OCAPI client, switch on Sync OCAPI Endpoints, then fill in:
- OCAPI Client ID and OCAPI Client Secret from your OCAPI client.
- OCAPI Hostname from the Hostnames tab.
- (Optional) List of Custom Object Types, with the names separated by commas.
- Enter an Asset Name.
- (Optional) Enter a Description.
- (Optional) Assign Tags.
- Select an Owner.
- Verify that your Salesforce Commerce Cloud account is successfully connected by clicking Test Connection.
- Click Connect.