CRM and CX Blog Posts by SAP
Stay up-to-date on the latest developments and product news about intelligent customer experience and CRM technologies through blog posts from SAP experts.
cancel
Showing results for 
Search instead for 
Did you mean: 
cuikenjian
Product and Topic Expert
Product and Topic Expert
2,973

Abstract

The SAP CX AI Toolkit is an advanced suite of AI-powered solutions designed to enhance the entire portfolio of SAP CX (customer experience) solutions (e.g. sales, services and commerce) by leveraging cutting-edge proprietary AI models and large language models. Especially for SAP Commerce Cloud, it offers AI-based features that allow you to e.g.:

  • extract and enrich product tags with image and text-based attributes, ensuring improved search accuracy and more personalized product recommendations,
  • generate compelling product content, ranging from captivating descriptions to engaging images,
  • enhances product discoverability through innovative visual search capabilities, making it easier for customers to find exactly what they need.

The learning journey Utilizing SAP CX AI Toolkit for SAP Commerce Cloud provides a fundamental introduction to the solution, while the short video Using SAP CX AI Toolkit in SAP Commerce Cloud provides a brief overview of major features along with practical demonstrations. But for a full list of features supported by the SAP CX AI Toolkit, please visit the dedicated SAP CX AI Toolkit Features page and the SAP CX AI Toolkit Help Portal.

In this blog post, I will guide you through the major steps required to integrate the SAP CX AI Toolkit with SAP Commerce Cloud.

Prerequisite

You should have:

  • a provisioned SAP CX AI toolkit tenant with admin role access.
  • an SAP Commerce Cloud instance with admin role access.

Overview of the Major Integration Steps

  1. Prepare the SAP Commerce Cloud server
  2. Set up the SAP CX AI Toolkit tenant
  3. Validate the connection and synchronize the data

Let's dive into each of these steps in more detail.

Step 1: Prepare the SAP Commerce Cloud Server

1.1 Prepare the manifest.json file and build/deploy SAP Commerce Cloud

To prepare the SAP Commerce Cloud server for integration with the SAP CX AI Toolkit, you need to ensure the necessary extensions are included in the 'manifest.json' file:

 

 

inboundservices
integrationbackoffice
integrationbackofficetest
integrationmonitoringbackoffice
integrationservices
odata2services
odata2webservices
outboundservices
outboundsync
outboundsyncbackoffice
webhookbackoffice
webhookservices

 

 

Next, make sure the 'odata2webservices' service is configured in one of the nodes in the 'manifest.json' file:

 

 

    "aspects": [
        {
            "name": "backoffice",
            "properties": [
                ...
            ],
            "webapps": [
                ...,
                {
                    "name": "odata2webservices"
                },

 

 

The odata2webservices facilitate communication between SAP Commerce Cloud and the SAP CX AI Toolkit. Please ensure you know which server node will host the 'odata2webservices' service. (In my case, the backoffice node will host it for demo purposes, but typically the API node is more suitable.)

Finally, trigger a build based on the prepared 'manifest.json' file and deploy the successful build to a specific SAP Commerce Cloud environment.

1.2 Check/validate the settings of the necessary integration objects

On the successfully deployed SAP Commerce Cloud, we need to ensure the following predefined integration objects are correctly configured:

  • IntegrationService
  • ScriptService
  • OutboundChannelConfig

Navigate to the Backoffice application and switch to the Integration UI Tool. First, check if these integration objects are OAuth enabled by selecting "Integration APIs | Authentication":

Screenshot 2024-10-18 at 22.10.06.png

If they are enabled for basic authentication, change the Authentication Type to "OAuth2" via ImpEx or manually:

Screenshot 2024-10-18 at 22.13.04.png

Ensure all three Inbound Channel Configurations are updated:

Screenshot 2024-10-18 at 22.14.52.png

Next, validate the exposed attributes of the integration objects. Navigate to "Integration Object Modeling | Type Modeling" and select, for example, the IntegrationService to view the exposed attributes.

Screenshot 2024-10-18 at 22.17.38.png

Compare them with the required attributes (for later communication with the SAP CX AI Toolkit):

  • IntegrationService: authenticationType(code), integrationObject(classes, code, integrationType, items).
  • ScriptService: autodisabling, code, content, description, disabled, scriptType (code).
  • OutboundChannelConfig: autoGenerate, code, destination (additionalProperties, credentialConsumedOAuth, destinationTarget(id) , endpoint, id, url), integrationObject(id), synchronizeDelete)

E.g., the IntegrationService object should expose 2 attributes: authenticationType and the integrationObject, while the attribute authenticateType should further expose the code attribute and the attribute integrationObject should further expose the classes, code, integrationType and items attributes.

If they don't match, identify and expose the missing attributes by checking the boxes next to the required attributes in each of the three integration objects listed above.

Lastly, ensure the 'oAuthUrl' attribute is exposed as part of the ConsumedDestination attribute in the OutboundChannelConfig object using the provided ImpEx scripts below:

 

 

INSERT_UPDATE IntegrationObjectItemAttribute;integrationObjectItem(integrationObject(code), code)[unique = true];attributeName[unique = true];attributeDescriptor(enclosingType(code),qualifier)
;OutboundChannelConfig:ConsumedOAuthCredential;oAuthUrl;ConsumedOAuthCredential:oAuthUrl;

 

 

You can use the administration console (hac) to import the ImpEx scirpts.

1.3 Create the OAuthClient for authentication with CX AI Toolkit

To enable CX AI Toolkit to get the authentication and authorization key for data communication with SAP Commerce Cloud, we also need to create an OAuthClient.

First, I'll create an Employee user in the administration cockpit in Backoffice, this user will be used later to relate to the OAuthClient for access management.

Screenshot 2024-10-18 at 22.42.25.png

I'll type in the necessary information including id, name, the default language (e.g., English) and currency (US dollar):

Screenshot 2024-10-18 at 22.45.24.pngScreenshot 2024-10-18 at 22.45.41.png

and ensure the user is in the admin group for demo purposes:

Screenshot 2024-10-18 at 22.45.56.png

Next, I'll create a new OAuthClient by selecting "System | OAuth | OAuth Clients" and using the subtype "Integration Client Credentials Details":

Screenshot 2024-10-18 at 22.53.05.png

Enter a meaningful OAuth client ID and secret (keep these for later setup on the CX AI toolkit side). Relate the newly created user to this OAuth client:

Screenshot 2024-10-18 at 22.55.14.png

Provide the authority of ROLE_INTEGRATIONADMINGROUP and validate that the grant type is set as "client_credentials":

Screenshot 2024-10-18 at 22.55.44.png

Enter the "basic" scope:

Screenshot 2024-10-18 at 22.56.19.png

Set the access and refresh token validity, then finalize the creation of the OAuth client:

Screenshot 2024-10-18 at 22.56.45.png

With these steps, the SAP Commerce Cloud server is ready for integration.

Step 2: Set Up the SAP CX AI Toolkit

I'll log into the SAP CX AI Toolkit tenant with the received admin user credentials. If you are not sure how to get the access credentials, check the getting access guide. On the home page, I'll click the user account icon on the top right, then select Settings:

Screenshot 2024-10-18 at 23.22.37.png

In the Settings workspace, I'll click Integrations and "Add Integration":

Screenshot 2024-10-18 at 23.24.34.png

Enter a meaningful name and choose "SAP Commerce Cloud" as the integration type:

Screenshot 2024-10-18 at 23.26.30.png

Now fill in the additional fields:

  • Host URL: The base URL where the 'odata2webservices' service is hosted (Check the 'manifest.json' file as discussed earlier. In my case, the service is hosted on the Backoffice node, so I can copy the domain URL of the Backoffice endpoint from the environment workspace on the Cloud Portal page.).
  • Client ID: The OAuth client ID created earlier.
  • Client Secret: The OAuth client secret.

Screenshot 2024-10-18 at 23.27.33.png

Click "Test Connection" (this might take a few seconds until the successful message is displayed)

Screenshot 2024-10-18 at 23.28.41.png

Once the connection is successful, choose the product catalogs and classification systems as the source:

Screenshot 2024-10-18 at 23.29.39.png

Please remember to choose all the product catalogs and classification systems that you plan to use, as you won't be able to add more later. If additional product catalogs or classification systems are needed later, you'll have to delete the current integration and create a new one. In my case, I select the two sample B2C product catalogs and the default classification system.

Please remember to save the integration. Once saved, I can check the Integration list to verify that it is active.

Screenshot 2024-10-18 at 23.36.02.png

That's how to set up the integration in the SAP CX AI Toolkit tenant. Let's move on to the next step to see how to validate the connection and synchronize the data.

Step 3: Validate the Connection and Synchronize the Data

To confirm that the necessary integration components are created in SAP Commerce Cloud, log into Backoffice and switch to the Integration UI Tool, and navigate to "Outbound Sync | Configuration | Channels":

Screenshot 2024-10-18 at 23.39.02.png

I can observe that two outbound channels for the two selected B2C product catalogs and one outbound channel for the default classification system have been created by the SAP CX AI Toolkit. To further verify this, I can check the Consumed Destination IDs (as shown above); I can notice that they correspond to the organization ID of the SAP CX AI Toolkit. This can be found under "Settings | Organization | Organization Details." in the SAP CX AI Toolkit tenant:

Screenshot 2024-10-18 at 23.46.57.png

Back to SAP Commerce Cloud Backoffice, under "Containers," "Streams," and "Jobs", I can also verify that the corresponding objects are created for data communication.

Lastly, let's visit "Outbound Sync | Scheduling | CronJobs" to see the created CronJobs responsible for data synchronization from SAP Commerce Cloud to SAP CX AI Toolkit:

Screenshot 2024-10-18 at 23.41.53.png

These CronJobs are responsible for synchronizing product data with the SAP CX AI Toolkit. Depending on the number of product catalogs selected, an equivalent number of CronJobs will be created, with each CronJob corresponding to a specific product catalog. Additionally, I can observe two extra CronJobs: one related to the classification system attributes and another covering the entire classification system, including its structure, attributes and values.

By default, the CronJobs related to the classification system and its attributes start immediately after the integration is established. When these CronJobs are executed, they will also trigger the other product catalog-related CronJobs accordingly.

To validate whether the data has been partially synchronized to the SAP CX AI Toolkit tenant, go to the tenant homepage and navigate to the Settings workspace, select "Commerce | Classification Attributes." These attributes come through the first CronJob, which should complete successfully within a few minutes. Click on the drop-down box of classification classes to view all synchronized classes.

Screenshot 2024-10-18 at 23.54.19.png

The initial synchronization process, which continues until all the CronJobs are successfully executed, may take several hours depending on the volume of data. Although it's not recommended, it is possible to trigger the product catalog CronJobs manually or on demand. To do this, simply click on the 'Run CronJob' action button for the individual CronJob.

Conclusion

I have demonstrated the key steps needed to successfully integrate SAP Commerce Cloud with the SAP CX AI Toolkit. This setup will enable seamless AI-driven enhancements to your SAP Commerce Cloud platform.

To explore further how to use the SAP CX AI Toolkit in conjunction with SAP Commerce Cloud, please refer to the User Guide on the SAP CX AI Toolkit help portal. Additionally, keep an eye out for our upcoming learning journey about the SAP CX AI Toolkit on learning.sap.com.

If you found this blog post helpful, give it a thumbs-up. Thank you for reading!