API Access

In order to use CommerceCloud (Demandware) actions you would need to create an API client for DigitalGenius platform to access your orders in CommerceCloud.

Create API Client

Follow the steps here to create an API client.

Make sure to assign Salesforce Commerce API role and give permissions to the OrderSearch resource.

Save the Client ID and Password (aka. Client Secret). These, together with Host URL, will be used by DigitalGenius actions to get access to your CommerceCloud orders.

Configure API Permissions

Under Site Development section click on Open Commerce API Settings.

1534

Click on Open Commerce API Settings

In the Select Type keep Shop and for Select Context choose the site you want to add DigitalGenius permissions to.

1528

Configure Permissions

To the configuration JSON add a new client entry with the client we created in the previous step. Use the following format but replace CLIENTID with your Client ID.

{
    "client_id": "__CLIENTID__",
    "allowed_origins": [],
    "resources": [
      {
        "resource_id": "/order_search",
        "methods": [
         "post"
        ],
        "read_attributes": "(**)",
        "write_attributes": "(**)"
      }
    ]  
}

So for example if your Client ID is "12345" then you would add the following entry:

{
    "client_id": "12345",
    "allowed_origins": [],
    "resources": [
      {
        "resource_id": "/order_search",
        "methods": [
         "post"
        ],
        "read_attributes": "(**)",
        "write_attributes": "(**)"
      }
    ]  
}

When you are adding the client entry you need to add to the list of existing entries. So for example if your current configuration is the following:

{
    "_v": "19.3",
    "clients": [
     
      {
    "client_id": "abcd",
    "allowed_origins": [],
    "resources": [
      {
        "resource_id": "/order_search",
        "methods": [
         "post"
        ],
        "read_attributes": "(**)",
        "write_attributes": "(**)"
      }
    ]  
 }
   ]
}

then after adding the new client it would look like this:

{
    "_v": "19.3",
    "clients": [
      
        {
    "client_id": "12345",
    "allowed_origins": [],
    "resources": [
      {
        "resource_id": "/order_search",
        "methods": [
         "post"
        ],
        "read_attributes": "(**)",
        "write_attributes": "(**)"
      }
    ]  
 },
     
      {
    "client_id": "abcd",
    "allowed_origins": [],
    "resources": [
      {
        "resource_id": "/order_search",
        "methods": [
         "post"
        ],
        "read_attributes": "(**)",
        "write_attributes": "(**)"
      }
    ]  
 }
   ]
}

The Host URLs for Commerce Cloud can be found on the Manage Sites page under the Sites section:

Once you click on the name of the storefront site, you will be directed to a new page. In the page's URL bar, you'll locate the URL that should be provided to Digital Genius. This will have the following format:

{hostUrl}/s/{siteId}

Here's an illustration: production-eu-digitalgenius.demandware.net/s/digitalgenius