Salesforce Commerce Cloud integration setup

When you start a new integration project, you need to provide Amplience with some configuration details so we can set up a new integration between Dynamic Content and your Salesforce Commerce Cloud (SFCC) instance. On this page we've included the details required to set up your integration and how you need to configure your SFCC instance.

For a content asset integration you will need to provide some additional information in addition to the details on this page. See SFCC content assets for more information.

Details you need to provide

You will need to provide Amplience with the following details in order to set up your integration with Dynamic Content.

Property                        Description
SFCC API Client ID In order to allow the Dynamic Content integration to access the Open Commerce API (OCAPI) on your Salesforce instance, create a new API client and provide us with the details. You can add a new API Client from the SFCC Account Manager.
SFCC API Secret When you create an API Client in the SFCC Account Manager, you will also specify an API Secret. See the Setting up a Client ID in SFCC section for more details.
businessManagerURL This is the domain of your SFCC instance.
site This is the site id that you wish to publish content to. Slots in SFCC are site specific.
ismlTemplate This is a template in your storefront cartridge that is used for slots of type HTML. The standard path for SiteGenesis is:
slots/html/htmlslotcontainer.isml
and the standard path for Storefront Reference Architecture (SFRA) is:
slots/html/htmlSlotContainer.isml
API path This is the path to your the Salesforce Open Commerce API (OCAPI) data API on your SFCC instance.
For example:
https://yoursandbox.demandware.net/s/-/dw/data
Note that there must be a valid SSL certificate attached to this domain.
For all sandboxes the SSL certificate is *.demandware.net so if your sandbox URL uses dot notation, for example: mydomain.cust-eu03.dw.demandware.net, it must be converted to dash notation: mydomain-cust-eu03-dw.demandware.net
version This is the version of OCAPI on your SFCC instance that you wish to use.
htmlTemplate This is the handlebars wrapper template that will be called by the integration to convert slot content into HTML. Rather than include all the logic in this top level template, we recommend using the handlebars partials feature to load in templates specific to a particular content type. See the handlebars page for more information on partials.
Note that all handlebars templates, including the wrapper template, must be stored in Content Hub. When you specify the name of the wrapper template it should not be suffixed with ".html", although it will appear as an HTML file in Content Hub.
Dynamic Content hub Each integration is set up for a specific Dynamic Content hub. If you have multiple hubs on your account, then you need to let us know which hub to use.

Setting up an API client in SFCC

In order to allow Dynamic Content to integrate with your SFCC instance, you will need to set up a new API Client in the SFCC account manager. In order to create an API Client, you must log in to the SFCC account manager as an admin user and follow these steps:

  1. In the SFCC account manager, go to the API Client screen. The "Add API Client" screen is shown in the image below.

  2. Click Add API Client

  3. Enter a display name to identify the API Client, for example, "Amplience Dynamic Content"

  4. Enter a password. This will be your client secret.

    Note: leave the sections JWT and OpenID as their defaults

  5. From the "Token Endpoint Auth Method" menu choose "client_secret_basic"

  6. Click 'Add'

  7. Make a note of the API Client ID that is generated.

  8. Provide the API Client ID and the Password that you entered in step 4 to Amplience.

The Add API Client screen in SFCC Account Manager
The Add API Client screen in SFCC Account Manager

The newly created API Client will be shown in the list.

The new API Client ID is shown in the list
The new API Client ID is shown in the list

Open Commerce API settings

To enable the Dynamic Content integration to access OCAPI on your SFCC instance you will also need to configure your OCAPI settings.

  1. In SFCC Business Manager, go to Administration > Site Development > Open Commerce API Settings
  2. From the Select Type field, select ‘Data’
  3. From the Select Context field, select ‘Global’ Note: Most Data API resources are organization-specific, so they support only global client permissions.
  4. In the text field, paste in the following JSON:
{
    "_v": "18.7",
    "clients": [{
        "client_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "resources": [{
            "resource_id": "/sites/{site_id}/slot_search",
            "methods": ["post"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        }, {
            "resource_id": "/sites/{site_id}/slots",
            "methods": ["get"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        }, {
            "resource_id": "/sites/{site_id}/slots/{slot_id}/slot_configurations/{configuration_id}",
            "methods": ["get", "put", "patch", "delete"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        }, {
            "resource_id": "/sites/{site_id}/slot_configurations",
            "methods": ["get"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        },{
            "resource_id": "/sites/{site_id}/slot_configuration_search",
            "methods": ["post"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        }, {
            "resource_id": "/sites/{site_id}/campaigns/{campaign_id}",
            "methods": ["get", "put", "patch", "delete"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        }, {
            "resource_id": "/sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id}",
            "methods": ["put", "patch", "delete"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        }, {
            "resource_id": "/sites/{site_id}/slot_configuration_campaign_assignment_search",
            "methods": ["post"],
            "read_attributes": "(**)",
            "write_attributes": "(**)"
        }]
    }]
}

Setting the API Client ID

Once you've added the JSON shown above, you must set the client_id property to the API Client ID you created for use with the integration. See Updating your OCAPI settings.
If you have other OCAPI settings that you need to keep, you will need to merge the data

Your OCAPI settings screen should look something like the following image:

OCAPI settings screen in Business Manager
OCAPI settings screen in Business Manager

If you're using content asset integration, you will need some additional OCAPI settings. See SFCC Content Assets for more details.

Updating your OCAPI settings

Once you've added the JSON, you will need to modify the values of the following properties.

Property                        Value
_v It is recommended to modify this to match the latest version of the configuration file structure. Please refer to the SFCC Documentation and search for "OCAPI Settings" for more details.
This property is independent of the OCAPI version itself and allows the configuration of resources in any OCAPI version.
client_id Change this to match your API Client ID.
This is required for staging, development and production instances. All sandboxes can use the default client id "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

When you've finished updating these values click "Save".

results matching ""

    No results matching ""