This guide walks you through the steps needed to connect your Salesforce Commerce Cloud (SFCC) store to Rep AI. By the end, you will have the 4 values required for the connection:
Field | Where to find it |
|---|---|
| SFCC Account Manager — API Client page |
| The password you set when creating the API Client |
| Your SFCC instance URL (e.g. |
| Business Manager — your storefront site identifier (e.g. |
Time Required: ~30 minutes
Prerequisites
SFCC Account Manager access (admin level) —
https://account.demandware.comSFCC Business Manager access (admin level)
Step 1: Create an API Client
Log in to Account Manager:
https://account.demandware.comNavigate to Account Information → API Client
Click Add API Client
Fill in the following:
Display Name:
Rep AIDescription: Rep AI shopping assistant integration
Password: Create a strong password — save it immediately, this is your
clientSecret
Make sure Enabled is checked
Under Organizations, assign the organization that owns your SFCC instance
Roles — leave empty. Do not assign any roles (such as
Salesforce Commerce APIorSLAS Organization Admin)Click Save
After saving, copy and store these two values:
Client ID → this is your
clientIdPassword (from step 4) → this is your
clientSecret
Step 2: Configure OCAPI Permissions
In Business Manager, navigate to:
Administration → Site Development → Open Commerce API Settings
You need to configure two sets of permissions: Data API and Shop API. Both must use Global context.
2a: Data API Permissions
Type:
DataContext:
Global
Paste the following JSON (replace YOUR_CLIENT_ID with the Client ID from Step 1):
{ "_v": "23.2", "clients": [ { "client_id": "YOUR_CLIENT_ID", "allowed_origins": [], "resources": [ { "resource_id": "/**", "methods": ["get", "post", "put", "patch", "delete"], "read_attributes": "(**)", "write_attributes": "(**)" }, { "resource_id": "/order_search", "methods": ["post"], "read_attributes": "(**)", "write_attributes": "(**)" } ] } ] }
Click Save, then wait 2–5 minutes for the configuration to propagate.
2b: Shop API Permissions
Type:
ShopContext:
Global
Paste the following JSON (replace YOUR_CLIENT_ID with the Client ID from Step 1):
{ "_v": 23.2, "clients": [ { "client_id": "YOUR_CLIENT_ID", "resources": [ { "resource_id": "/products/*", "methods": ["get"], "read_attributes": "(**)" }, { "resource_id": "/order_search", "methods": ["post"], "read_attributes": "(**)", "write_attributes": "(**)" } ] } ] }
Click Save, then wait 2–5 minutes for the configuration to propagate.
Step 3: Find Your Instance Hostname and Site ID
Instance Hostname
Your instanceHostname is the domain of your SFCC instance. It typically looks like:
your-store.dx.commercecloud.salesforce.com
You can find it in Business Manager — it's the hostname in your browser's address bar when logged in (without any path).
Site ID
Your siteId is the identifier for your storefront site. To find it:
In Business Manager, go to Administration → Sites → Manage Sites
Your Site ID is listed in the ID column (e.g.
RefArch,SiteGenesis, or a custom name)
Step 4: Provide Your Credentials to Rep AI
Once you have all 4 values, share them with your Rep AI contact:
{ "clientId": "your-client-id", "clientSecret": "your-client-secret", "instanceHostname": "your-store.dx.commercecloud.salesforce.com", "siteId": "your-site-id" }
Verification Checklist
Before sharing your credentials, confirm:
Troubleshooting
Connection fails with 403 Forbidden
Verify the API Client is Enabled in Account Manager
Verify both Data and Shop OCAPI JSONs contain your correct Client ID
Ensure context is set to Global (not site-specific)
Ensure no
Salesforce Commerce APIrole is assigned to the clientWait a few more minutes — OCAPI config propagation can take up to 5 minutes
Missing product pricing data
Ensure Shop API permissions are configured (not just Data API)
Verify price books exist and are assigned to your site in Business Manager
Common mistakes
Setting OCAPI context to a specific site instead of Global
Assigning SCAPI roles to the OCAPI client
Forgetting to enable the API Client
Configuring only the Data API and missing the Shop API
Not waiting for OCAPI configuration to propagate
Widget Installation
After Rep AI confirms the connection is successful, you will receive a widget embed code to place on your storefront.
SFRA (Storefront Reference Architecture)
Add the provided snippet to:
app_storefront_base/cartridge/templates/default/common/htmlHead.isml
Paste it before </head>.
PWA Kit
Add the provided snippet at the app/root level in:
_app-config/index.jsx
After Installation
Deploy your storefront changes
Open your storefront and verify the widget loads
If the widget does not appear, ensure your Content Security Policy (CSP) allows the Rep AI loader domain