# Salesforce Commerce Cloud

### Overview

The Salesforce Commerce Cloud integration provides visibility into your Salesforce Commerce Cloud environment, including users, roles, and their associated permissions.

### Configuring Salesforce Commerce Cloud

To integrate Veza with Salesforce Commerce Cloud, you will need to:

* [Create a client ID](#create-a-client-id) with required access permission and scope in Account Manager.
* [Configure Business Manager Instances](#configure-business-manager-instances) to allow access to your instances via the API.
* [Configure the Veza integration](#adding-the-integration-to-veza), providing client id, password, and your list of Business Manager instances.

> For testing the integration, you will need a developer instance, which you can register at <https://developer.salesforce.com/signup>.
>
> The Salesforce account to discover must have [API access enabled](https://help.salesforce.com/s/articleView?id=sf.security_api_access_control_about.htm\&type=5).

#### Create a client ID

To conduct the API calls, Veza will need a client account in Salesforce Account Manager.

To create the client account, add an API client in Account Manager, and add Salesforce Commerce API role to the client. In role scope, add instances to which this API client will have access to.

See [Add an API Client in B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_account_manager_add_api_client_id.htm\&type=5) in the Salesforce documentation for more details.

#### Configure Business Manager Instances

Grant the API client access to your Business Manager instance by adding permissions under **Administration** > **Site Development** > **Open Commerce API Settings**. Using *Data* type and *Global (organization-wide)* context, enter following permission:

```json
{
  "client_id": "<YOUR-CLIENT-ID>",
  "resources": [
    {
      "resource_id": "/users/**",
      "methods": ["get"],
      "read_attributes": "(**)"
    },
    {
      "resource_id": "/roles/**",
      "methods": ["get"],
      "read_attributes": "(**)"
    },
    {
      "resource_id": "/sites/**",
      "methods": ["get"],
      "read_attributes": "(**)"
    },
    {
      "resource_id": "/permissions/**",
      "methods": ["get"],
      "read_attributes": "(**)"
    }
  ]
}
```

For example:

```json
{
  "_v": "18.1",
  "clients": [
    {
      "client_id": "<YOUR-CLIENT-ID>",
      "resources": [
        {
          "resource_id": "/users/**",
          "methods": ["get"],
          "read_attributes": "(**)"
        },
        {
          "resource_id": "/roles/**",
          "methods": ["get"],
          "read_attributes": "(**)"
        },
        {
          "resource_id": "/sites/**",
          "methods": ["get"],
          "read_attributes": "(**)"
        },
        {
          "resource_id": "/permissions/**",
          "methods": ["get"],
          "read_attributes": "(**)"
        }
      ]
    }
  ]
}
```

See the [OCAPI Settings](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-commerce-ocapi/ocapisettings.html) documentation for more details.

### Adding the integration to Veza

1. In Veza, go to the **Integrations** page.
2. Click **Add Integration** and search for Salesforce Commerce Cloud. Click on it and click **Next**.
3. Enter the following details:

| Field                        | Description                                                                                                                                                |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *Name*                       | A unique name to identify the Salesforce Commerce Cloud provider.                                                                                          |
| *Client ID*                  | The client ID you created in Account Manager.                                                                                                              |
| *Password*                   | The password for the client ID.                                                                                                                            |
| *Business Manager Instances* | A comma-separated list of Business Manager instances. For example: `instance1.dx.commercecloud.salesforce.com, instance2.dx.commercecloud.salesforce.com`. |

4. Click **Create Integration** to save the configuration.

#### Notes and Supported Entities

The integration currently supports the following **Salesforce Commerce Cloud Objects**:

* Salesforce Business Manager User
* Salesforce Business Manager Role
* Salesforce Business Manager Permission
* Salesforce Business Manager Site
* Salesforce Business Manager Organization
* Salesforce Business Manager Locale

#### Supported Attributes

The following properties are available to filter results throughout the Veza interface:

| Entity     | Property                           | Value                                                                          |
| ---------- | ---------------------------------- | ------------------------------------------------------------------------------ |
| User       | `Email`                            | User email                                                                     |
| User       | `Login`                            | User login                                                                     |
| User       | `External Id`                      | External ID (Account Manager ID)                                               |
| User       | `Is Locked`                        | Flag whether the user is locked                                                |
| User       | `Last Login At`                    | Last login date of the user - timestamp is normalized to midnight 00:00:00 UTC |
| Role       | `Description`                      | Role description                                                               |
| Role       | `User Manager`                     | Flag whether this role is allowed to manage users or other access roles        |
| Permission | `Description`                      | Permission description                                                         |
| Permission | `Business Manager Permission Type` | Permission type (`module`/`functional`/`locale`)                               |
| Permission | `Access Type`                      | Access type (`READONLY`/`ACCESS`)                                              |
| Site       | `Description`                      | Site description                                                               |
| Site       | `Site Id`                          | Site identifier within Business Manager                                        |
| Locale     | `Locale Id`                        | Locale identifier within Business Manager                                      |

Notes on attributes: Permission type and notation indicate Salesforce [Open Commerce API](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-commerce-ocapi/get-started-with-ocapi.html) permissions:

**Permission Type**:

* `module` permissions are equivalent to the **Business Manager Modules** permissions in Business Manager UI.
* `functional` permissions are equivalent to the **Functional Permissions** in Business Manager UI.
* `locale` permissions are equivalent to the **Locale Permissions** in Business Manager UI.

**Access Type**:

* `READONLY` access type is equivalent to the `Read` permission in Business Manager UI.
* `ACCESS` access type is equivalent to the `Write` permission in Business Manager UI or single check box, such as for functional permissions.

#### Limitations

**Permissions**: Veza discovers the following permission types: `module`, `functional`, `locale`;


---

# 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://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/integrations/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.
