Salesforce Commerce Cloud B2C MCP Server
Create a powerful Model Context Protocol (MCP) server for Salesforce Commerce Cloud B2C in minutes with our AI Gateway. This guide walks you through setting up seamless B2C commerce integration with enterprise-grade security and instant OAuth authentication.
About Salesforce Commerce Cloud B2C API
Salesforce Commerce Cloud B2C (formerly Demandware) is a leading cloud-based e-commerce platform for creating unified, intelligent digital commerce experiences. The B2C Commerce API provides comprehensive access to:
- Product Catalog: Products, categories, variants, and inventory
- Customer Management: Profiles, preferences, and loyalty programs
- Shopping Cart: Cart management, wishlist, and gift registry
- Order Management: Order placement, tracking, and history
- Promotions: Campaigns, coupons, and dynamic pricing
- Content Management: Site content, assets, and localization
- Search & Navigation: AI-powered search and recommendations
- Storefront APIs: Headless commerce capabilities
Key Features
- Shop API: Customer-facing commerce operations
- Data API: Administrative and data management
- Meta API: Configuration and metadata access
- OCAPI: Open Commerce API for custom integrations
- Multi-Site: Support for multiple brands/regions
- Einstein AI: Built-in AI recommendations
- PWA Support: Progressive Web App capabilities
- Global Scale: CDN and edge computing
What You Can Do with Salesforce Commerce Cloud B2C MCP Server
The MCP server transforms Salesforce B2C Commerce API into a natural language interface, enabling AI agents to:
Product & Catalog Management
-
Product Operations
- "Create new product with variants for sizes and colors"
- "Update inventory levels across all warehouses"
- "Set product availability by region"
- "Manage product images and rich media"
-
Category Management
- "Reorganize category hierarchy for better navigation"
- "Create seasonal categories for holiday shopping"
- "Set category-specific sorting rules"
- "Configure category landing pages"
-
Search Optimization
- "Configure search synonyms and redirects"
- "Boost products in search results"
- "Set up faceted search refinements"
- "Create search merchandising rules"
Customer Experience Management
-
Customer Profiles
- "View customer purchase history and preferences"
- "Update customer loyalty points and tier status"
- "Manage customer addresses and payment methods"
- "Track customer engagement metrics"
-
Personalization
- "Show personalized product recommendations"
- "Display targeted content based on behavior"
- "Create customer segments for marketing"
- "Configure Einstein recommendations"
-
Lists & Registries
- "Manage customer wishlists and favorites"
- "Create gift registries for events"
- "Share lists with friends and family"
- "Track registry completion rates"
Shopping Cart & Checkout
-
Cart Management
- "Add products to cart with selected options"
- "Apply promotions and discount codes"
- "Calculate shipping costs and taxes"
- "Save cart for later purchase"
-
Checkout Process
- "Process guest and registered checkouts"
- "Validate payment methods and addresses"
- "Handle multi-shipping scenarios"
- "Integrate with payment gateways"
-
Order Processing
- "Place orders with inventory allocation"
- "Send order confirmation emails"
- "Track order status and shipments"
- "Process returns and exchanges"
Promotions & Pricing
-
Campaign Management
- "Create percentage or fixed amount discounts"
- "Set up buy-one-get-one promotions"
- "Configure free shipping thresholds"
- "Schedule seasonal sales campaigns"
-
Dynamic Pricing
- "Implement tiered pricing based on quantity"
- "Set customer group specific prices"
- "Configure regional price adjustments"
- "Manage sale prices with date ranges"
-
Coupon Management
- "Generate unique coupon codes"
- "Set usage limits and restrictions"
- "Track coupon redemption rates"
- "Create customer-specific offers"
Analytics & Insights
-
Sales Analytics
- "Track revenue by product category"
- "Analyze conversion funnel metrics"
- "Monitor average order value trends"
- "Identify top-performing products"
-
Customer Analytics
- "Segment customers by purchase behavior"
- "Track customer lifetime value"
- "Analyze retention and churn rates"
- "Monitor customer satisfaction scores"
-
Performance Metrics
- "Monitor site performance and uptime"
- "Track page load speeds by region"
- "Analyze search query performance"
- "Measure campaign effectiveness"
Multi-Site & Localization
-
Site Management
- "Configure sites for different brands"
- "Set up regional storefronts"
- "Manage site-specific catalogs"
- "Configure localized experiences"
-
Localization
- "Translate product content by locale"
- "Configure currency and tax settings"
- "Set regional shipping options"
- "Manage local payment methods"
-
Content Management
- "Update homepage banners and content"
- "Manage content slots and widgets"
- "Schedule content publishing"
- "A/B test different layouts"
Integration & Automation
-
Order Management System
- "Sync orders to fulfillment systems"
- "Update inventory from warehouse"
- "Process shipment notifications"
- "Handle order status updates"
-
Marketing Integration
- "Sync customer data to marketing cloud"
- "Trigger abandoned cart emails"
- "Export segments for campaigns"
- "Track campaign attribution"
-
ERP Integration
- "Sync product master data"
- "Update pricing from ERP"
- "Export financial transactions"
- "Maintain data consistency"
Prerequisites
- Access to Cequence AI Gateway
- Salesforce Commerce Cloud B2C instance
- Account Manager API client credentials
- Business Manager access
Step 1: Create Commerce Cloud API Client
Before setting up the MCP server, you need to create API credentials in Account Manager.
1.1 Access Account Manager
- Navigate to account.demandware.com
- Log in with your Commerce Cloud credentials
- Select your organization
1.2 Create API Client
- Go to API Clients
- Click Add API Client
- Configure client settings:
- Name: "AI Gateway MCP Integration"
- Description: "MCP server for B2C Commerce"
- Organizations: Select your org
1.3 Configure Scopes
Select the required scopes:
sfcc.shopper-products
sfcc.shopper-customers
sfcc.shopper-orders
sfcc.shopper-promotions
sfcc.shopper-baskets
sfcc.shopper-search
For admin operations, also add:
sfcc.products
sfcc.customers
sfcc.orders
sfcc.catalogs
1.4 Generate Credentials
- Click Generate Client ID
- Save the Client ID and Client Secret
- Note your Instance Short Code
- Configure allowed redirect URIs:
https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
Step 2: Access AI Gateway Apps
- Log in to your Cequence AI Gateway dashboard
- Navigate to Apps in the left sidebar
- You'll see the list of available third-party applications
Step 3: Find and Select Salesforce Commerce Cloud B2C API
- In the Apps section, browse through the Third-party category
- Look for Salesforce Commerce Cloud B2C or use the search function
- Click on the Salesforce Commerce Cloud B2C API card to view details
Step 4: Create MCP Server
- Click the Create MCP Server button on the API card
- You'll be redirected to the MCP Server creation wizard
Step 5: Configure API Endpoints
In the App Configuration step:
-
Base URL: Enter your Commerce Cloud API endpoint
- Format:
https://{short-code}.api.commercecloud.salesforce.com
- Example:
https://kv7kzm78.api.commercecloud.salesforce.com
- Format:
-
Select API endpoints to expose to your MCP server
-
Click Next to proceed
Step 6: MCP Server Basic Setup
Configure your MCP server details:
-
MCP Server Name: Enter a descriptive name
- Example: "B2C Commerce Storefront"
- This name will identify your server in the dashboard
-
Description (Optional): Add details about the server's purpose
- Example: "E-commerce operations and customer experience management"
-
Production Mode: Toggle based on your needs
- ON for production environments
- OFF for development/testing
-
Click Next to continue
Step 7: Configure Authentication
This is where you'll use your API Client credentials:
-
Authentication Type: Select OAuth 2.0
-
Fill in the OAuth configuration:
-
Authorization URL:
https://account.demandware.com/dwsso/oauth2/authorize
-
Token URL:
https://account.demandware.com/dwsso/oauth2/access_token
-
Client ID: Paste from Account Manager
-
Client Secret: Paste from Account Manager
-
Redirect URI:
https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
-
-
Scopes: Select from available scopes (see next section)
Available Salesforce Commerce Cloud B2C OAuth Scopes
Configure the appropriate scopes based on your application needs:
Shopper API Scopes
-
sfcc.shopper-products
- Read product information
- Search products
- View inventory
- Access product recommendations
-
sfcc.shopper-customers
- Manage customer profiles
- Update preferences
- Access order history
- Manage addresses
-
sfcc.shopper-orders
- Place orders
- View order details
- Track shipments
- Process returns
-
sfcc.shopper-baskets
- Manage shopping carts
- Apply promotions
- Calculate totals
- Save for later
Administrative Scopes
-
sfcc.products
- Create/update products
- Manage inventory
- Configure variants
- Set pricing
-
sfcc.catalogs
- Manage categories
- Configure navigation
- Set assignments
- Control visibility
-
sfcc.customers
- Full customer management
- Access all profiles
- Manage segments
- Export data
Recommended Scope Combinations
For Storefront Operations:
sfcc.shopper-products
sfcc.shopper-customers
sfcc.shopper-orders
sfcc.shopper-baskets
sfcc.shopper-promotions
sfcc.shopper-search
For Full Management:
sfcc.products
sfcc.customers
sfcc.orders
sfcc.catalogs
sfcc.promotions
sfcc.content
Step 8: Configure Security
Set up API protection features:
-
API Protection: Toggle ON to enable
- Protects against bot attacks, DDoS, and threats
- Monitors for suspicious activity
- Rate limiting and anomaly detection
-
Protection Features (when enabled):
- Auto-scaling protection
- Managed infrastructure
- Built-in monitoring
- Zero maintenance required
-
Click Next to continue
Step 9: Choose Deployment Method
Select your deployment preference:
Option A: Deploy to Cequence Cloud (Recommended)
- Fully managed deployment
- Automatic scaling and monitoring
- Built-in high availability
Option B: Deploy with Helm Chart
- Self-managed Kubernetes deployment
- Full control over infrastructure
- Requires Kubernetes expertise
Click Next after selecting.
Step 10: Review and Deploy
Review your MCP server configuration:
- MCP Server Name: Your chosen name
- Base URL: Your Commerce Cloud endpoint
- Selected Endpoints: Number of endpoints selected
- Authentication: OAuth 2.0 (Configured)
- API Protection: Enabled/Disabled
- Deployment: Your selected method
Click Create & Deploy to finalize the setup.
Using Your Salesforce Commerce Cloud B2C MCP Server
With Claude Desktop
-
Open Claude Desktop settings
-
Add your MCP server:
{
"servers": {
"sfcc-b2c": {
"url": "your-mcp-server-url",
"auth": {
"type": "oauth2",
"client_id": "your-client-id"
}
}
}
} -
Start using natural language commands:
- "Show bestselling products from last month"
- "Create a 20% off promotion for summer collection"
- "Find customers who abandoned carts today"
- "Update inventory for SKU-12345 to 500 units"
- "Generate report of orders by payment method"
API Integration Example
// Initialize MCP client
const mcpClient = new MCPClient({
serverUrl: 'your-mcp-server-url',
auth: {
type: 'oauth2',
token: 'access-token'
}
});
// Search products
const products = await mcpClient.sfcc.products.search({
q: 'summer dress',
refine: ['c_refinementColor=red', 'price=(0..100)'],
sort: 'best-matches',
limit: 20
});
// Get customer profile
const customer = await mcpClient.sfcc.customers.get({
customerId: 'customer-id'
});
// Create basket
const basket = await mcpClient.sfcc.baskets.create({
currency: 'USD',
locale: 'en-US'
});
// Add item to basket
await mcpClient.sfcc.baskets.addItem({
basketId: basket.basketId,
productId: 'product-id',
quantity: 2
});
// Apply promotion
await mcpClient.sfcc.baskets.applyPromotion({
basketId: basket.basketId,
code: 'SUMMER20'
});
// Create order
const order = await mcpClient.sfcc.orders.create({
basketId: basket.basketId
});
Common Use Cases
E-commerce Operations
- Product catalog management
- Dynamic pricing and promotions
- Inventory synchronization
- Order fulfillment automation
- Customer service tools
Marketing & Personalization
- Einstein recommendations
- Targeted promotions
- Email campaign triggers
- Customer segmentation
- A/B testing
Analytics & Optimization
- Conversion funnel analysis
- Product performance tracking
- Customer behavior insights
- Revenue optimization
- Search effectiveness
Security Best Practices
-
API Security:
- Use HTTPS only
- Implement rate limiting
- Monitor API usage
- Regular credential rotation
-
Data Protection:
- PCI compliance for payments
- GDPR compliance for customer data
- Secure credential storage
- Audit logging
-
Access Control:
- Least privilege principle
- Role-based permissions
- IP allowlisting
- Session management
Troubleshooting
Common Issues
-
401 Unauthorized
- Verify client credentials
- Check token expiration
- Ensure correct scopes
- Validate redirect URI
-
403 Forbidden
- Check Business Manager permissions
- Verify site assignment
- Review scope requirements
- Check IP restrictions
-
429 Rate Limited
- Implement exponential backoff
- Use batch operations
- Check rate limit headers
- Consider caching
Getting Help
- Documentation: AI Gateway Docs
- Support: support@cequence.ai
- Community: AI Gateway Forum
- SFCC Docs: Commerce Cloud Developer Center