# Salesforce Commerce Cloud

Alhena connects to Salesforce Commerce Cloud using SCAPI (Shopper APIs).

## Prerequisites

* A Salesforce Commerce Cloud store
* SCAPI credentials from your Commerce Cloud Account Manager

## Getting Your SCAPI Credentials

You'll need the following from your Salesforce Commerce Cloud Account Manager:

1. **Client ID** - Your API client identifier
2. **Client Secret** - Your API client secret
3. **Short Code** - Your organization's short code (e.g., `kv7kzm78`)
4. **Organization ID** - Your organization identifier (e.g., `f_ecom_zzxy_001`)
5. **Site ID** - Your storefront site ID (e.g., `RefArch`)

## Setup

### Step 1: Enable Salesforce Commerce Cloud in Alhena

1. In Alhena, go to **Settings > Integrations**
2. Find **Salesforce Commerce Cloud** and click **Enable**
3. You'll be taken to the configuration page

### Step 2: Connect Your Store

Enter your SCAPI credentials:

1. **Client ID**
2. **Client Secret**
3. **Short Code**
4. **Organization ID**
5. **Site ID**
6. **Site URL** - Your storefront URL (e.g., `https://www.yourstore.com`)

Click **Connect** to complete the setup.

***

## Enabled Agents

When you connect your Salesforce Commerce Cloud store, the following agents are enabled:

| Agent                      | Description                                                                |
| -------------------------- | -------------------------------------------------------------------------- |
| **Order management agent** | Handles order inquiries, tracking, and order-related customer support      |
| **Product expert agent**   | Provides detailed product information, specifications, and recommendations |

You can configure these agents in **AI Settings > Agents**.

***

## Custom Product Fields

Salesforce Commerce Cloud supports custom product attributes. You can configure which custom fields to sync so Alhena can answer questions about them.

1. Go to **Settings > Integrations > Salesforce Commerce Cloud**
2. Scroll to **Custom Product Fields**
3. Add the attribute IDs for the custom fields you want to include (e.g., `c_ingredients`, `c_howToUse`, `c_size`)

***

## Recommended: Add Your Store to Training

After connecting, we recommend adding your storefront domain to your training URLs so Alhena can learn from your product pages and help articles. See [Training on Websites](https://alhena.gitbook.io/docs/ai-configuration/data-sources/websites) for more information.

***

## Disconnecting

To disconnect your Salesforce Commerce Cloud store:

1. Go to **Settings > Integrations > Salesforce Commerce Cloud**
2. Click **Disconnect**
3. Confirm the disconnection

This will disable the Salesforce Commerce Cloud-connected agents and revoke access to your store data.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alhena.gitbook.io/docs/integrations/ecommerce/integrating-alhena-ai-with-salesforce-commerce-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
