Salesforce Commerce Cloud
Enabling Agentforce agents to interact with Salesforce Commerce Cloud for product discovery, basket management, order processing, and customer data.
The Salesforce Commerce Cloud Connector for ACP allows Agentforce agents to tap into your e-commerce platform, enabling a wide range of functionalities from product browsing and basket manipulation to order placement and customer account management. This empowers agents to assist users with their shopping experience, provide product information, and manage e-commerce transactions.
Purpose and Capabilities
This Connector facilitates interaction with Salesforce Commerce Cloud’s capabilities, primarily via OCAPI (Open Commerce API) or SCAPI (Salesforce Commerce API).
Tool Name | Description | Example Inputs |
---|---|---|
commerce_cloud_search_products | Searches for products based on keywords, category, or other filters. | search_query , category_id (optional) , refinements_map (optional) , sort_rule |
commerce_cloud_get_product_details | Retrieves detailed information for a specific product ID. | product_id , expand_options (e.g., images, prices, availability) |
commerce_cloud_get_product_availability | Checks real-time availability/stock for a product. | product_id , inventory_list_id (optional) |
commerce_cloud_get_product_price | Gets the price(s) for a specific product. | product_id , quantity (optional) |
commerce_cloud_add_item_to_basket | Adds a specified quantity of a product to the current user’s basket. | product_id , quantity , options_map (optional) |
commerce_cloud_get_basket | Retrieves the contents of the current user’s active basket. | basket_id (if known, else uses session) |
commerce_cloud_update_basket_item | Updates the quantity or options of an item in the basket. | basket_id , item_id , quantity (optional) , options_map (optional) |
commerce_cloud_remove_basket_item | Removes an item from the basket. | basket_id , item_id |
commerce_cloud_create_order_from_basket | Converts the current basket into an order (places the order). | basket_id , payment_instrument_id , shipping_address_id |
commerce_cloud_get_customer_orders | Retrieves a list of orders for the authenticated customer. | customer_id , status_filter (optional) , date_range (optional) |
commerce_cloud_get_order_details | Retrieves detailed information for a specific order. | order_no or order_id |
commerce_cloud_get_customer_profile | Retrieves the profile information for the authenticated customer. | customer_id |
commerce_cloud_update_customer_profile | Updates the profile information for the authenticated customer. | customer_id , profile_data_map |
commerce_cloud_get_store_availability | (For BOPIS) Checks product availability at specific store locations. | product_id , store_ids_list or postal_code , radius |
Prerequisites
- Salesforce Commerce Cloud Instance: An active B2C or B2B Commerce Cloud instance (SiteGenesis, SFRA, or PWA Kit/Composable Storefront).
- API Client Configuration:
- An API Client ID (and potentially a Client Secret or API Key depending on the authentication method) must be configured in Commerce Cloud Account Manager or Business Manager.
- Permissions for the API Client must be set correctly to allow access to the desired OCAPI/SCAPI resources (e.g., Shop API, Data API).
- OCAPI/SCAPI Settings:
- Ensure the relevant OCAPI or SCAPI settings are enabled and configured for your site(s) in Business Manager (e.g., global preferences, site-specific preferences, resource permissions).
- Familiarity with your instance’s OCAPI/SCAPI version and base URLs.
- Understanding of Commerce Cloud Concepts: Knowledge of Commerce Cloud terms like Products, Categories, Baskets (Carts), Orders, Promotions, Customer Profiles, Inventory Lists, Site Configuration, etc.
Setup Instructions
- Configure API Client in Commerce Cloud:
- Account Manager (for OCAPI Client ID): Create an API Client with appropriate organization-level roles.
- Business Manager (for OCAPI/SCAPI settings):
- Navigate to Administration > Site Development > Open Commerce API Settings (or relevant SCAPI configuration area).
- Define API client permissions for specific resources and HTTP methods (e.g.,
GET /products
,POST /baskets
). - Ensure the API client has access to the sites it needs to interact with.
- Securely store the Client ID, Client Secret (if applicable), and any other relevant credentials.
- Configure ACP Connector:
- The ACP administrator will configure the Commerce Cloud Connector settings within ACP.
- This will involve providing the Client ID, any necessary secrets/keys, the base URL for your Commerce Cloud instance’s APIs (e.g.,
https://your-instance.commercecloud.salesforce.com/s/YourSite/dw/shop/vXX_X
), and specifying the authentication mechanism to be used (e.g., Client Credentials Grant, Shopper Login and API Access Service - SLAS).
- Verify Connection:
- Use a simple tool like
commerce_cloud_search_products
with a common keyword to test if the connection, authentication, and basic API access are functioning.
- Use a simple tool like
Common Use Cases
- Product Discovery & Assistance: Agent helps a user find products, check details, or compare items.
- Shopping Cart Management: Agent adds items to a user’s cart, updates quantities, or removes items on their behalf.
- Order Placement & Status: Agent assists a user in placing an order or checks the status of an existing order.
- Customer Account Support: Agent helps a user retrieve their order history or update their profile information.
- Personalized Recommendations (via Product Data): Agent uses product data to suggest related items or promotions.
- Inventory Checks: Agent checks if a product is in stock online or at a nearby store (if BOPIS is enabled).
Troubleshooting Tips
- Authentication Errors (401 Unauthorized):
- Verify API Client ID and any secrets/keys are correct.
- Ensure the API Client is enabled and has the correct grant types configured.
- For OCAPI, check that the
x-dw-client-id
header is being sent correctly. - For SCAPI with SLAS, ensure the token exchange process is working.
- Permission Denied (403 Forbidden):
- The API Client lacks the necessary permissions for the specific OCAPI/SCAPI resource or HTTP method being accessed. Review permissions in Business Manager.
- Ensure the API client has access to the specific site being targeted.
- Resource Not Found (404 Not Found):
- Double-check product IDs, category IDs, order numbers, etc.
- Verify the OCAPI/SCAPI endpoint path and version are correct.
- Incorrect Site Context: Ensure API calls are targeting the correct Commerce Cloud site ID if your instance has multiple sites.
- API Rate Limits: Commerce Cloud APIs have rate limits. Monitor usage and implement retry mechanisms if necessary.
- OCAPI/SCAPI Versioning: Be mindful of the API version you are targeting, as capabilities and request/response structures can change between versions.
- Customizations: If your Commerce Cloud instance has significant customizations to objects or APIs, standard tools might need adjustments or custom tools might be required.
This connector provides a powerful link between Agentforce agents and your Salesforce Commerce Cloud storefronts.