CX Works

CX Works brings the most relevant leading practices to you.
It is a single portal of curated, field-tested and SAP-verified expertise for SAP Customer Experience solutions

How to Import Product Data to SAP Marketing Cloud

30 min read

How to Import Product Data to SAP Marketing Cloud

Product data is one of the main master data which needs to be set up correctly in SAP Marketing Cloud, before it can be used operationally. Normally, the product data is imported from Enterprise Resource Planning (ERP) or Commerce Platform to SAP Marketing Cloud using SAP Integration Suite. If you are using SAP products, such as SAP ECC, SAP S/4HANA, or SAP Commerce, you can leverage the standard integration package which is already prebuilt for you to bring the product data to SAP Marketing Cloud.

In this article, we are not going to dwell on those prebuilt integrations. Rather, we are going to provide you with some considerations that you need to take into account while importing product data to SAP Marketing Cloud using the OData API, particularly when it is used together with the Cloud Integration capability within SAP Integration Suite.

This article does extend the existing documentation by providing some examples and use cases, but it does not replace the corresponding section of the official SAP Help Portal for SAP Marketing Cloud.

Table of Contents


Scope

In this article, we are going to discuss some considerations that you need to take into account while importing product data to SAP Marketing Cloud using product OData API (API_MKT_PRODUCT_SRV) as described in the SAP API documentation listed below.

In the past, product data can be imported using the Compound Import Service (CUAN_IMPORT_SRV), but this API has been deprecated and should no longer be used.

Normally, the product data is imported to SAP Marketing Cloud together with category and hierarchy data. The categorization and classification of products is crucial for product recommendations, filters within segmentation, reporting, and analysis purposes. However, in this article, we are not going to discuss product category and hierarchy data in detail; rather they will be only mentioned when they are relevant to product data.

Product data can also be imported manually as a file through the Data File Load application in SAP Marketing Cloud. It should be used instead of the Import Data application, please view this SAP enablement video to gain a better understanding of this application.

Product Data in SAP Marketing Cloud

Product data is used in multiple processes across SAP Marketing Cloud such as in product recommendations, offers, campaign scenarios, as well as creating predictive and segmentation models. It is crucial to get it imported correctly to the system, otherwise, all other applications which are dependent on the product data will not work properly.

Product Data Model

Before we deep dive into the product OData API, it is better to have a good understanding of the product data model in SAP Marketing Cloud.

As you can see from the product data model above, a product can be defined as a base product or it can be set in relation to one base product. A product also can be part of one or more product categories as well as a direct part of one or more product hierarchies.

For example, we can define "Smartphone X" as a base product and then later define "Smartphone X2" as a product with the "Smartphone X" as its based product.

As another example, we can define "Smartphone XYZ" as a product under a product category called "Smartphone" which in turn is part of a product hierarchy called "Mobile Device". Or we can define "Smartphone XYZ" as a product directly under a product hierarchy called "Mobile Device".

As depicted in the product data model above, category and hierarchy data must be imported first to SAP Marketing Cloud before importing product data. Otherwise, the product will be created in SAP Marketing Cloud without proper assignment to the categories and hierarchies.

You may find it useful to view this SAP enablement video to understand the product data model further.

Communication Arrangement

To import product data into SAP Marketing Cloud via OData API, you will need to configure a communication user, a communication system, and a communication arrangement using their respective applications in SAP Marketing Cloud. 

The communication arrangement will need to be created with scenario ID SAP_COM_0171 as shown below.

The purpose of the configuration is to provide a technical user that has the relevant authorizations to access the product OData API. If you use other users than the one defined in the communication arrangement, you will get an unauthorized error as shown below in the Message Monitor application in Cloud Integration.

You may want to refer to this CX Article on how to set up the communication arrangement if you are not familiar with this step.

Product OData API

To import product data to SAP Marketing Cloud through Cloud Integration, we need to understand the usage of the Public OData API (API_MKT_PRODUCT_SRV) below:

Entity Set

Entity Type

Entity Type Description

Products

Product

The Master Record

ProductOriginDataSet

ProductOriginData

Product origin data refer to products in SAP Marketing Cloud. Product data is collected and merged from several sources into the master data tables within SAP Marketing Cloud.

ProductCategoryAssignments

ProductCategoryAssignment

Product categories are assigned to a product.

ProductNames ProductName The product name master record.

ProductOriginDataNames

ProductOriginDataName

Product name and description can be defined per the origin of the product data.

AdditionalIDs

AdditionalID

Additional ID of the product from a different product origin.

You may find out more on how to use these entity sets and function imports within the product OData API by going through the SAP Help Portal documentation.

The SAP Marketing Cloud product OData API processes the incoming message asynchronously, meaning it will just accept and store the incoming payload first before processing it in a different session.

Import Monitor

The product OData API processes the incoming message asynchronously. Therefore it does not mean the product is already imported or updated successfully in SAP Marketing Cloud, if you get a successful response. Hence, if you cannot find the product is imported or updated in the Use and Resonance application in SAP Marketing Cloud, you might want to check its processing status in the Import Monitor application. If the message is not fully processed yet, it will be in the In Process tab. Once it is processed, the message will be either in the Error or Success tab.

For example, the message below is erroneous because the related product category wasn't imported to the system beforehand.

View Product Data

Once the message is processed successfully in SAP Marketing Cloud, you can view the product in SAP Marketing Cloud in a visual form by using Products - Use and Resonance application. Over here, you can ensure whether the product is created or updated correctly as intended.

Aside from the product details information, you may also find product reviews and ratings information, provided the necessary system, such as commerce is already integrated with SAP Marketing Cloud. On the top of the page, you can also see the image of the product, as well as statistics showing the number of clicks in recommendations and emails.

You may find it useful to view this SAP enablement video if you are not familiar with Products - Use and Resonance Application.

Importing Product Data to SAP Marketing Cloud

If a standard integration package is available, it is recommended that you use the standard product integration flow. If you have specific requirements, you may enhance it using pre-exit and post-exit integration flows. In case you need to develop a custom integration flow, please consider the following points.

Considerations when Creating a Custom Integration Flow

  1. Design the integration flow to handle different possible scenarios.
    • For example, your integration flow should be designed to handle an error when the relevant product categories and hierarchies are not imported yet to SAP Marketing Cloud. Or how to merge products from one system with those from another system, so that products are not duplicated in SAP Marketing Cloud.
  2. Use the correct XML Schema Definitions (XSD) for mapping purposes. 
    • It is recommended to generate XSD from the OData Adapter in Cloud Integration. Depending on the scenario, you may need to adjust the sub-level of the nodes to generate the proper XSD. You will get a popup screen asking whether to overwrite the existing XSD or create it as a new XSD. Once it is generated, you can find the XSD in the resources tab, which you can use in the mapping step of the integration flow.
  3. URL-encode the URI part when there is non-alphanumerical value.
    • If your URI value contains special character such as a colon (:), you will need to URL-encode it, otherwise you will get "Invalid URI segment" error.
  4. Use Request-Reply and not Send step for external calls in Cloud Integration to get a response from SAP Marketing Cloud OData API. 
    • Your integration flow should be designed to handle a negative response from the OData API (HTTP status code other than 200, 201, 202 and 204). Otherwise, you will get into a situation, where you get no error in the Message Monitor application in the Cloud Integration, but the message is nowhere to be found in the Import Monitor application in SAP Marketing Cloud. 
  5. Use a valid combination of the OData API entity set and HTTP operation. 
    • Even though it is possible to combine any operations, such as Query (GET), Read (GET), Create (POST), Update (PUT), Delete (DELETE), Merge (MERGE), and Patch (PATCH) with any entity sets in the OData Adapter setting in Cloud Integration, you will need to ensure it is a valid combination as per product OData API documentation. Otherwise, you will get the error message "Operation not supported for the entity type" in the Cloud Integration.

The SAP Marketing Cloud product OData API only supports batch processing, therefore you need to switch on the batch mode in the OData adapter in Cloud Integration to make it work properly.

Metadata of Product OData API

At times you might want to check the OData API metadata to understand how the message payload should be built properly. For this purpose, you can retrieve the metadata using a $metadata parameter as shown below.

Request GET /sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/$metadata
Response
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData">
    <edmx:DataServices m:DataServiceVersion="2.0">
        <Schema Namespace="API_MKT_PRODUCT_SRV" xml:lang="en" sap:schema-version="1" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
            <EntityType Name="ProductOriginData" sap:content-version="2">
                <Key>
                    <PropertyRef Name="ProductOrigin"/>
                    <PropertyRef Name="ProductID"/>
                </Key>
                <Property Name="ProductOrigin" Type="Edm.String" Nullable="false" MaxLength="30" sap:unicode="false" sap:label="Origin of Product"/>
                <Property Name="ProductID" Type="Edm.String" Nullable="false" MaxLength="50" sap:unicode="false" sap:label="Product ID"/>
                <Property Name="ProductImageURL" Type="Edm.String" MaxLength="1333" sap:unicode="false" sap:label="Product URL" sap:sortable="false" sap:filterable="false"/>
                <Property Name="WebsiteURL" Type="Edm.String" MaxLength="1333" sap:unicode="false" sap:label="Website URL" sap:sortable="false" sap:filterable="false"/>
                <Property Name="Brand" Type="Edm.String" MaxLength="50" sap:unicode="false" sap:label="Brand"/>
                <Property Name="IsBaseProduct" Type="Edm.Boolean" sap:unicode="false" sap:label="Is Base Product"/>
                <Property Name="BaseProductID" Type="Edm.String" MaxLength="50" sap:unicode="false" sap:label="Base Product ID"/>
                <Property Name="BaseProductOrigin" Type="Edm.String" MaxLength="30" sap:unicode="false" sap:label="Base Product Origin"/>
                <Property Name="ProductValidEndDate" Type="Edm.DateTime" Precision="0" sap:unicode="false" sap:label="Valid To"/>
                <NavigationProperty Name="ProductNames" Relationship="API_MKT_PRODUCT_SRV.ProductOriginDataProductOriginDataName" FromRole="FromRole_ProductOriginDataProductOriginDataName" ToRole="ToRole_ProductOriginDataProductOriginDataName"/>
                <NavigationProperty Name="ProductCategoryAssignments" Relationship="API_MKT_PRODUCT_SRV.ProductOriginDataProdCategoryAssignment" FromRole="FromRole_ProductOriginDataProdCategoryAssignment" ToRole="ToRole_ProductOriginDataProdCategoryAssignment"/>
                <NavigationProperty Name="Product" Relationship="API_MKT_PRODUCT_SRV.ProductOriginDataProduct" FromRole="FromRole_ProductOriginDataProduct" ToRole="ToRole_ProductOriginDataProduct"/>
            </EntityType>
            ...
        </Schema>
    </edmx:DataServices>
</edmx:Edmx>

The metadata above does not show the full Entity Data Model of the Product OData API.

Create Product

To create products using OData API, you need to use the valid combination of HTTP operation and entity sets as shown below:

  • Use the PATCH (MERGE) operation on the entity set ProductOriginDataSet, to create a product.
  • Use POST operation on the entity set ProductOriginDataSet via navigation parameter ProductCategoryAssignments to assign a product to categories,
  • Use POST operation on the entity set ProductOriginDataSet via navigation parameter ProductNames to provide product descriptions.
  • Use PATCH (MERGE) operation on the entity set AdditionalIDs to set additional IDs to the existing product.

We are going to provide some request payload examples for your reference on how to create products in SAP Marketing Cloud.

Create Product with Category Assignments and Descriptions

The request payload below is pulled from the integration flow before it hits the OData adapter, whereas the response payload is pulled after it passes the OData Adapter step in Cloud Integration. 

Request
<?xml version='1.0' encoding='UTF-8'?>
<batchParts>
    <batchChangeSet>
        <batchChangeSetPart>
            <method>MERGE</method>
            <uri>ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')</uri> 
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-07-23T06:34:13</headerValue>
                </header>
            </headers>
            <ProductOriginDataSet>
                <ProductOriginData>
                    <ProductID>Z1422224</ProductID>
                    <ProductImageURL>https://images-na.ssl-images-amazon.com/images/I/41V%2BriFamZL._AC_.jpg</ProductImageURL>
                    <WebsiteURL>Z1422224</WebsiteURL>
                    <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
                </ProductOriginData>
            </ProductOriginDataSet>
        </batchChangeSetPart>
        <batchChangeSetPart>
            <method>POST</method>
            <uri>ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')/ProductCategoryAssignments</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-07-23T06:34:13</headerValue>
                </header>
            </headers>
            <ProductCategoryAssignments>
                <ProductCategoryAssignment>
                    <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
                    <ProductID>Z1422224</ProductID>
                    <ProductCategoryHierarchyID>electronicsProductCatalog:Online</ProductCategoryHierarchyID>
                    <ProductCategoryID>827</ProductCategoryID>
                </ProductCategoryAssignment>
            </ProductCategoryAssignments>
        </batchChangeSetPart>
        <batchChangeSetPart>
            <method>POST</method>
            <uri>ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')/ProductNames</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-07-23T06:34:13</headerValue>
                </header>
            </headers>
            <ProductOriginDataNames>
                <ProductOriginDataName>
                    <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
                    <ProductID>Z1422224</ProductID>
                    <Language>en</Language>
                    <ProductDescription>Canon ZBG-E5 Battery Grip for EOS 450D</ProductDescription>
                    <Name>ZBG-E5</Name>
                </ProductOriginDataName>
            </ProductOriginDataNames>
        </batchChangeSetPart>
    </batchChangeSet>
</batchParts>
Response
<batchPartResponse>
    <batchChangeSetResponse>
      <batchChangeSetPartResponse>
        <headers>
          <Accept></Accept>
          <location>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataSet(ProductOrigin=&apos;SAP_HYBRIS_PRODUCT&apos;, ProductID=&apos;Z1422224&apos;)</location>
          <Accept-Language></Accept-Language>
          <Content-Length>2090</Content-Length>
          <dataserviceversion>2.0</dataserviceversion>
          <Content-Type>application/atom+xml;type=entry</Content-Type>
        </headers>
        <statusInfo>OK</statusInfo>
        <contentId/>
        <body>
          <ProductOriginDataSet>
            <ProductOriginData>
              <Brand></Brand>
              <YY1_PROD_LAUNCH_DATE_MPR/>
              <ProductValidEndDate/>
              <BaseProductID></BaseProductID>
              <ProductImageURL></ProductImageURL>
              <WebsiteURL></WebsiteURL>
              <BaseProductOrigin></BaseProductOrigin>
              <ProductID>Z1422224</ProductID>
              <YY1_PROD_LAUNCH_DATE_MPRF>0</YY1_PROD_LAUNCH_DATE_MPRF>
              <IsBaseProduct>false</IsBaseProduct>
              <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
            </ProductOriginData>
          </ProductOriginDataSet>
        </body>
        <statusCode>200</statusCode>
      </batchChangeSetPartResponse>
      <batchChangeSetPartResponse>
        <headers>
          <Accept></Accept>
          <location>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductCategoryAssignments(ProductOrigin=&apos;SAP_HYBRIS_PRODUCT&apos;, ProductID=&apos;Z1422224&apos;, ProductCategoryHierarchyID=&apos;electronicsProductCatalog%3AOnline&apos;, ProductCategoryID=&apos;827&apos;)</location>
          <Accept-Language></Accept-Language>
          <Content-Length>1498</Content-Length>
          <dataserviceversion>2.0</dataserviceversion>
          <Content-Type>application/atom+xml;type=entry</Content-Type>
        </headers>
        <statusInfo>Created</statusInfo>
        <contentId/>
        <body>
          <ProductCategoryID>827</ProductCategoryID>
          <ProductID>Z1422224</ProductID>
          <ProductCategoryHierarchyID>electronicsProductCatalog:Online</ProductCategoryHierarchyID>
          <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
        </body>
        <statusCode>201</statusCode>
      </batchChangeSetPartResponse>
      <batchChangeSetPartResponse>
        <headers>
          <Accept></Accept>
          <location>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataNames(ProductOrigin=&apos;SAP_HYBRIS_PRODUCT&apos;, ProductID=&apos;Z1422224&apos;, Language=&apos;EN&apos;)</location>
          <Accept-Language></Accept-Language>
          <Content-Length>1250</Content-Length>
          <dataserviceversion>2.0</dataserviceversion>
          <Content-Type>application/atom+xml;type=entry</Content-Type>
        </headers>
        <statusInfo>Created</statusInfo>
        <contentId/>
        <body>
          <Language>EN</Language>
          <ProductID>Z1422224</ProductID>
          <ProductDescription>Canon ZBG-E5 Battery Grip for EOS 450D</ProductDescription>
          <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
          <Name>ZBG-E5</Name>
        </body>
        <statusCode>201</statusCode>
      </batchChangeSetPartResponse>
    </batchChangeSetResponse>
  </batchPartResponse>

The request payload below is pulled from the integration flow after it hits the OData adapter, whereas the response payload is pulled during the OData Adapter step in Cloud Integration. Basically, the messages below are the same as the ones above, except the request message below is the actual payload which is sent to the OData API and the response message is the actual response payload from the OData API. 

Request
--batch
Content-Type: multipart/mixed; boundary=changeset_58b28d47-9e75-4321-9718-797aeb052159

--changeset_58b28d47-9e75-4321-9718-797aeb052159
Content-Type: application/http
Content-Transfer-Encoding: binary

MERGE ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT') HTTP/1.1
Content-Length: 634
Sap-Cuan-SequenceId: SAP_HYBRIS_PRODUCT
Sap-Cuan-RequestTimestamp: 2020-07-27T09:16:38
Content-Type: application/atom+xml

<?xml version='1.0' encoding='utf-8'?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002"><content type="application/xml"><m:properties><d:ProductImageURL>https://images-na.ssl-images-amazon.com/images/I/41V%2BriFamZL._AC_.jpg</d:ProductImageURL><d:WebsiteURL>Z1422224</d:WebsiteURL><d:ProductID>Z1422224</d:ProductID><d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin></m:properties></content></entry>

--changeset_58b28d47-9e75-4321-9718-797aeb052159
Content-Type: application/http
Content-Transfer-Encoding: binary

POST ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')/ProductCategoryAssignments HTTP/1.1
Content-Length: 626
Sap-Cuan-SequenceId: SAP_HYBRIS_PRODUCT
Sap-Cuan-RequestTimestamp: 2020-07-27T09:16:38
Content-Type: application/atom+xml

<?xml version='1.0' encoding='utf-8'?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002"><content type="application/xml"><m:properties><d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin><d:ProductID>Z1422224</d:ProductID><d:ProductCategoryHierarchyID>electronicsProductCatalog:Online</d:ProductCategoryHierarchyID><d:ProductCategoryID>827</d:ProductCategoryID></m:properties></content></entry>

--changeset_58b28d47-9e75-4321-9718-797aeb052159
Content-Type: application/http
Content-Transfer-Encoding: binary

POST ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')/ProductNames HTTP/1.1
Content-Length: 620
Sap-Cuan-SequenceId: SAP_HYBRIS_PRODUCT
Sap-Cuan-RequestTimestamp: 2020-07-27T09:16:38
Content-Type: application/atom+xml

<?xml version='1.0' encoding='utf-8'?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002"><content type="application/xml"><m:properties><d:ProductDescription>Canon ZBG-E5 Battery Grip for EOS 450D</d:ProductDescription><d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin><d:ProductID>Z1422224</d:ProductID><d:Language>en</d:Language><d:Name>ZBG-E5</d:Name></m:properties></content></entry>

--changeset_58b28d47-9e75-4321-9718-797aeb052159--
--batch--
Response
--A9B76D83D906259F9294820BE5193E180
Content-Type: multipart/mixed; boundary=A9B76D83D906259F9294820BE5193E181
Content-Length:      8161

--A9B76D83D906259F9294820BE5193E181
Content-Type: application/http
Content-Length: 2382
content-transfer-encoding: binary

HTTP/1.1 200 OK
Content-Type: application/atom+xml;type=entry
Content-Length: 2090
dataserviceversion: 2.0
location: https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataSet(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224')

<?xml version="1.0" encoding="utf-8"?><entry xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"><id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataSet(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224')</id><title type="text">ProductOriginDataSet(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224')</title><updated>2020-07-27T09:16:41Z</updated><category term="API_MKT_PRODUCT_SRV.ProductOriginData" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="ProductOriginDataSet(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224')" rel="self" title="ProductOriginData"/><link href="ProductOriginDataSet(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224')/ProductNames" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ProductNames" type="application/atom+xml;type=feed" title="ProductNames"/><link href="ProductOriginDataSet(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224')/ProductCategoryAssignments" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ProductCategoryAssignments" type="application/atom+xml;type=feed" title="ProductCategoryAssignments"/><link href="ProductOriginDataSet(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224')/Product" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Product" type="application/atom+xml;type=entry" title="Product"/><content type="application/xml"><m:properties><d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin><d:ProductID>Z1422224</d:ProductID><d:ProductImageURL/><d:WebsiteURL/><d:Brand/><d:IsBaseProduct>false</d:IsBaseProduct><d:BaseProductID/><d:BaseProductOrigin/><d:ProductValidEndDate m:null="true"/><d:YY1_PROD_LAUNCH_DATE_MPR m:null="true"/><d:YY1_PROD_LAUNCH_DATE_MPRF>0</d:YY1_PROD_LAUNCH_DATE_MPRF></m:properties></content></entry>

--A9B76D83D906259F9294820BE5193E181
Content-Type: application/http
Content-Length: 1889
content-transfer-encoding: binary

HTTP/1.1 201 Created
Content-Type: application/atom+xml;type=entry
Content-Length: 1498
location: https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductCategoryAssignments(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',ProductCategoryHierarchyID='electronicsProductCatalog%3AOnline',ProductCategoryID='827')
dataserviceversion: 2.0

<?xml version="1.0" encoding="utf-8"?><entry xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"><id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductCategoryAssignments(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',ProductCategoryHierarchyID='electronicsProductCatalog%3AOnline',ProductCategoryID='827')</id><title type="text">ProductCategoryAssignments(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',ProductCategoryHierarchyID='electronicsProductCatalog%3AOnline',ProductCategoryID='827')</title><updated>2020-07-27T09:16:41Z</updated><category term="API_MKT_PRODUCT_SRV.ProductCategoryAssignment" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="ProductCategoryAssignments(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',ProductCategoryHierarchyID='electronicsProductCatalog%3AOnline',ProductCategoryID='827')" rel="self" title="ProductCategoryAssignment"/><content type="application/xml"><m:properties><d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin><d:ProductID>Z1422224</d:ProductID><d:ProductCategoryHierarchyID>electronicsProductCatalog:Online</d:ProductCategoryHierarchyID><d:ProductCategoryID>827</d:ProductCategoryID></m:properties></content></entry>

--A9B76D83D906259F9294820BE5193E181
Content-Type: application/http
Content-Length: 1563
content-transfer-encoding: binary

HTTP/1.1 201 Created
Content-Type: application/atom+xml;type=entry
Content-Length: 1250
location: https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataNames(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',Language='EN')
dataserviceversion: 2.0

<?xml version="1.0" encoding="utf-8"?><entry xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"><id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataNames(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',Language='EN')</id><title type="text">ProductOriginDataNames(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',Language='EN')</title><updated>2020-07-27T09:16:41Z</updated><category term="API_MKT_PRODUCT_SRV.ProductOriginDataName" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="ProductOriginDataNames(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',Language='EN')" rel="self" title="ProductOriginDataName"/><content type="application/xml"><m:properties><d:ProductDescription>Canon ZBG-E5 Battery Grip for EOS 450D</d:ProductDescription><d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin><d:ProductID>Z1422224</d:ProductID><d:Language>EN</d:Language><d:Name>ZBG-E5</d:Name></m:properties></content></entry>

--A9B76D83D906259F9294820BE5193E181--

--A9B76D83D906259F9294820BE5193E180--

As you can see from both request payloads above, the batch request consists of 3 batchChangeSetPart

  1. In the first batchChangeSetPart, we create a product via PATCH (MERGE) operation on the entity set ProductOriginDataSet
  2. In the second batchChangeSetPart, we assign the product to a category via POST operation on the entity set ProductOriginDataSet via navigation parameter ProductCategoryAssignments.
  3. In the third batchChangeSetPart, we provide an English product description via POST operation on the entity set ProductOriginDataSet via navigation parameter ProductNames.

Once the above message is posted successfully, you will be able to view the loaded product using the Products - Use and Resonance application in SAP Marketing Cloud.

In addition to the standard product attributes, you can add customer-specific fields to it using the Custom Fields and Logic application in SAP Marketing Cloud. Please refer to this SAP Help documentation and this blog which describes how standard business objects can be linked to products.

Create Product with Additional IDs

It is common to have products used in multiple systems, for example, product A exists in your SAP ERP system to track product availability, and it is also used in your SAP Sales Cloud (C4C) to track sales-related activities. However, if we are not careful, the product might be created as 2 separate products in SAP Marketing Cloud. Therefore, whenever possible, we want to ensure there is only one single source of truth system to be integrated with SAP Marketing Cloud.

However, what if we also need to get interactions of product A from SAP Sales Cloud to SAP Marketing Cloud? In such a case, you can use the entity set AdditionalIDs in the OData API. You can add SAP Sales Cloud product ID to the existing product from SAP ERP, so we can capture the sales-related interactions into SAP Marketing Cloud too. Below is the sample payload on how to create additional IDs for the existing product.

Request Message Payload Example for Create Product with Additional IDs
<?xml version='1.0' encoding='UTF-8'?>
<batchParts>
    <batchChangeSet>
        <batchChangeSetPart>
            <method>PATCH</method>
            <uri> AdditionalIDs(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT',AdditionalProductOrigin='SAP_C4C_PRODUCT',AdditionalProductID='407901109D5FBCF31500B0E4B2FD1696')</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-07-23T06:34:13</headerValue>
                </header>
            </headers>
            <AdditionalIDs>
                <AdditionalID>
                <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
                <ProductID>Z1422224</ProductID>
                <AdditionalProductOrigin>SAP_C4C_PRODUCT</AdditionalProductOrigin>
                <AdditionalProductID>407901109D5FBCF31500B0E4B2FD1696</AdditionalProductID>
                </AdditionalID>
            </AdditionalIDs>
        </batchChangeSetPart>
    </batchChangeSet>
</batchParts>

Update Product

The following list shows the valid HTTP operations and entity set combinations for the Update product scenario:

  • To update a product, you need to use the PATCH (MERGE) operation on the entity set ProductOriginDataSet.
  • To update product category assignment, you need to use POST operation on the entity set ProductOriginDataSet via navigation parameter ProductCategoryAssignments.
  • To update product descriptions, you need to use POST operation on the entity set ProductOriginDataSet via navigation parameter ProductNames.
  • To set additional IDs to the existing product, you need to use PATCH (MERGE) operation on the entity set AdditionalIDs.

As you can see, updating products works similarly as creating products. Nevertheless, there are few considerations when you update products that need to be taken into account.

Update Product Expiry Dates and Descriptions

To update the product expiry date, we can perform PATCH (MERGE) operation on the entity set ProductOriginDataSet and to update product descriptions, we can use POST operation on the entity set ProductOriginDataSet via navigation parameter ProductNames. Below is the sample payload on how to update product expiry dates and product descriptions.

Request Message Payload Example to Update Product Expiry Date and Descriptions
<?xml version='1.0' encoding='UTF-8'?>
<batchParts>
    <batchChangeSet>
        <batchChangeSetPart>
            <method>PATCH</method>
            <uri>ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-10-30T05:06:18</headerValue>
                </header>
            </headers>
            <ProductOriginDataSet>
                <ProductOriginData>
                    <ProductID>Z1422224</ProductID>
                    <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
                    <ProductValidEndDate>2029-12-31T00:00:00</ProductValidEndDate>
                </ProductOriginData>
            </ProductOriginDataSet>
        </batchChangeSetPart>
        <batchChangeSetPart>
            <method>POST</method>
            <uri>ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')/ProductNames</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-10-30T04:46:04</headerValue>
                </header>
            </headers>
            <ProductOriginDataNames>
                <ProductOriginDataName>
                    <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
                    <ProductID>Z1422224</ProductID>
                    <Language>en</Language>
                    <ProductDescription>Canon BG-E5 Battery Grip for EOS 450D is the best!</ProductDescription>
                    <Name>ZBG-E5</Name>
                </ProductOriginDataName>
            </ProductOriginDataNames>
        </batchChangeSetPart>
    </batchChangeSet>
</batchParts>

Once the update was done successfully, then we should be able to find the updated product by using the Products - Use and Resonance application in SAP Marketing Cloud.

Update Product Category Assignments

As you can see from the product data model, a product can be assigned to one or many product categories or directly to one or many product hierarchies. Throughout the product life cycle, this categorization or classification might change, thus the product information might need to be resent from source systems to SAP Marketing Cloud. If your integration flow is not designed properly, you might end up having a product with duplicated or with invalid product categories.

  • Example 1: when a product A was first imported into SAP Marketing Cloud, it was classified under category B in the source system. However, as the business evolves, it does now make sense to categorize it also under new category C. When the product A is resent, it will also carry both categories B and C. If the integration flow is not designed correctly, you might end up having product A under 2 categories B and 1 category C in SAP Marketing Cloud.
  • Example 2: when a product was first imported into SAP Marketing Cloud, it was classified under category Y in the source system. However, as the business evolves, it does now make sense to shift it to category Z instead of Y. When the product X is resent, it will carry only category Z. If the integration flow is not designed correctly, you might end up having product X under category Y and category Z in SAP Marketing Cloud.

To overcome the issues, you need to ensure your integration flow removes the existing product category assignments first by using function import DeleteProductCategoryAssignments, before creating new ones for a particular product. Below is the sample payload on how to use the function import DeleteProductCategoryAssignments.

Request Message Payload Example to Update Product with Categories
<?xml version='1.0' encoding='UTF-8'?>
<batchParts>
    <batchChangeSet>
        <batchChangeSetPart>
            <method>POST</method>
            <uri>DeleteProductCategoryAssignments?ProductID='1422224',ProductOrigin='SAP_HYBRIS_PRODUCT',HierarchyID='electronicsProductCatalog%3AOnline'</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-10-30T05:06:18</headerValue>
                </header>
            </headers>
        </batchChangeSetPart>
        <batchChangeSetPart>
            <method>POST</method>
            <uri>ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')/ProductCategoryAssignments</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-10-23T06:34:13</headerValue>
                </header>
            </headers>
            <ProductCategoryAssignments>
                <ProductCategoryAssignment>
                    <ProductOrigin>SAP_HYBRIS_PRODUCT</ProductOrigin>
                    <ProductID>Z1422224</ProductID>
                    <ProductCategoryHierarchyID>electronicsProductCatalog:Online</ProductCategoryHierarchyID>
                    <ProductCategoryID>827</ProductCategoryID>
                </ProductCategoryAssignment>
            </ProductCategoryAssignments>
        </batchChangeSetPart>
    </batchChangeSet>
</batchParts>

Merge Products

What if similar products from multiple sources are already imported to SAP Marketing Cloud and now you would like to merge them into one single product master data? In such a case, you can make use of the function import MergeProductOriginData in the OData API. Below is the sample payload on how to use the function import MergeProductOriginData.


<?xml version='1.0' encoding='UTF-8'?>
<batchParts>
    <batchChangeSet>
        <batchChangeSetPart>
            <method>PATCH</method>
            <uri>MergeProductOriginData?(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT',AdditionalProductOrigin='SAP_C4C_PRODUCT',AdditionalProductID='407901109D5FBCF31500B0E4B2FD1696')</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-10-30T06:34:13</headerValue>
                </header>
            </headers>
        </batchChangeSetPart>
    </batchChangeSet>
</batchParts>

Function import MergeProductOriginData can be used to merge products with different ProductIDs from different origins into one product in SAP Marketing Cloud. Both products need to be replicated beforehand. The ProductOriginData addressed with an AdditionalProductOrigin will then be moved as additional product data to product addressed with ProductID and ProductOrigin.

It is not possible to merge a product as an additional product to two different main products.

Read Product

To retrieve the product information from SAP Marketing Cloud, you can use Read (GET) HTTP Operation with suitable query and navigation parameters.

Read a Product Based Product ID

You can retrieve a specific product using parameter $filter as shown below:

Request GET /sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/Products?$filter=ProductID eq 'Z1422224'
Reply
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/">
    <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/Products</id>
    <title type="text">Products</title>
    <updated>2020-07-27T06:54:11Z</updated>
    <author>
        <name/>
    </author>
    <link href="Products" rel="self" title="Products"/>
    <entry>
        <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')</id>
        <title type="text">Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')</title>
        <updated>2020-07-27T06:54:11Z</updated>
        <category term="API_MKT_PRODUCT_SRV.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
        <link href="Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')" rel="self" title="Product"/>
        <link href="Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')/ProductOriginDataSet" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ProductOriginDataSet" type="application/atom+xml;type=feed" title="ProductOriginDataSet"/>
        <link href="Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')/ProductCategoryAssignments" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ProductCategoryAssignments" type="application/atom+xml;type=feed" title="ProductCategoryAssignments"/>
        <link href="Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')/ProductNames" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ProductNames" type="application/atom+xml;type=feed" title="ProductNames"/>
        <content type="application/xml">
            <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                <d:ProductUUID>68b0d090-6708-5d2c-1700-74029b2217d8</d:ProductUUID>
                <d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin>
                <d:ProductID>Z1422224</d:ProductID>
                <d:ProductImageURL>https://images-na.ssl-images-amazon.com/images/I/41V%2BriFamZL._AC_.jpg</d:ProductImageURL>
                <d:WebsiteURL>Z1422224</d:WebsiteURL>
                <d:Brand></d:Brand>
                <d:IsBaseProduct>false</d:IsBaseProduct>
                <d:BaseProductID></d:BaseProductID>
                <d:BaseProductOrigin></d:BaseProductOrigin>
                <d:ProductValidEndDate m:null="true"/>
                <d:YY1_PROD_LAUNCH_DATE_MPR m:null="true"/>
                <d:YY1_PROD_LAUNCH_DATE_MPRF>3</d:YY1_PROD_LAUNCH_DATE_MPRF>
            </m:properties>
        </content>
    </entry>
</feed>

Read Product Category Assignments

You can retrieve product category assignments using a navigation parameter ProductCategoryAssignments as shown below:

Request GET /sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')/ProductCategoryAssignments
Response
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/">
    <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/Products(guid%2768b0d090-6708-5d2c-1700-74029b2217d8%27)/ProductCategoryAssignments</id>
    <title type="text">ProductCategoryAssignments</title>
    <updated>2020-07-27T07:20:07Z</updated>
    <author>
        <name/>
    </author>
    <link href="Products(guid%2768b0d090-6708-5d2c-1700-74029b2217d8%27)/ProductCategoryAssignments" rel="self" title="ProductCategoryAssignments"/>
    <entry>
        <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductCategoryAssignments(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',ProductCategoryHierarchyID='electronicsProductCatalog%3AOnline',ProductCategoryID='827')</id>
        <title type="text">ProductCategoryAssignments(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',ProductCategoryHierarchyID='electronicsProductCatalog%3AOnline',ProductCategoryID='827')</title>
        <updated>2020-07-27T07:20:07Z</updated>
        <category term="API_MKT_PRODUCT_SRV.ProductCategoryAssignment" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
        <link href="ProductCategoryAssignments(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',ProductCategoryHierarchyID='electronicsProductCatalog%3AOnline',ProductCategoryID='827')" rel="self" title="ProductCategoryAssignment"/>
        <content type="application/xml">
            <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                <d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin>
                <d:ProductID>Z1422224</d:ProductID>
                <d:ProductCategoryHierarchyID>electronicsProductCatalog:Online</d:ProductCategoryHierarchyID>
                <d:ProductCategoryID>827</d:ProductCategoryID>
            </m:properties>
        </content>
    </entry>
</feed>

Read Product Names & Descriptions

You can retrieve product names and descriptions using a navigation parameter ProductNames as shown below:

Request GET /sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/Products(guid'68b0d090-6708-5d2c-1700-74029b2217d8')/ProductNames
Response
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/">
    <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/Products(guid%2768b0d090-6708-5d2c-1700-74029b2217d8%27)/ProductNames</id>
    <title type="text">ProductNames</title>
    <updated>2020-07-27T07:35:28Z</updated>
    <author>
        <name/>
    </author>
    <link href="Products(guid%2768b0d090-6708-5d2c-1700-74029b2217d8%27)/ProductNames" rel="self" title="ProductNames"/>
    <entry>
        <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductNames(ProductUUID=guid'68b0d090-6708-5d2c-1700-74029b2217d8',Language='EN')</id>
        <title type="text">ProductNames(ProductUUID=guid'68b0d090-6708-5d2c-1700-74029b2217d8',Language='EN')</title>
        <updated>2020-07-27T07:35:28Z</updated>
        <category term="API_MKT_PRODUCT_SRV.ProductName" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
        <link href="ProductNames(ProductUUID=guid'68b0d090-6708-5d2c-1700-74029b2217d8',Language='EN')" rel="self" title="ProductName"/>
        <content type="application/xml">
            <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                <d:ProductDescription>Canon ZBG-E5 Battery Grip for EOS 450D</d:ProductDescription>
                <d:ProductUUID>68b0d090-6708-5d2c-1700-74029b2217d8</d:ProductUUID>
                <d:Language>EN</d:Language>
                <d:Name>ZBG-E5</d:Name>
            </m:properties>
        </content>
    </entry>
    <entry>
        <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductNames(ProductUUID=guid'68b0d090-6708-5d2c-1700-74029b2217d8',Language='ZH')</id>
        <title type="text">ProductNames(ProductUUID=guid'68b0d090-6708-5d2c-1700-74029b2217d8',Language='ZH')</title>
        <updated>2020-07-27T07:35:28Z</updated>
        <category term="API_MKT_PRODUCT_SRV.ProductName" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
        <link href="ProductNames(ProductUUID=guid'68b0d090-6708-5d2c-1700-74029b2217d8',Language='ZH')" rel="self" title="ProductName"/>
        <content type="application/xml">
            <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                <d:ProductDescription>佳能 ZBG-E5 电池手柄,用于 EOS 450D</d:ProductDescription>
                <d:ProductUUID>68b0d090-6708-5d2c-1700-74029b2217d8</d:ProductUUID>
                <d:Language>ZH</d:Language>
                <d:Name>ZBG-E5</d:Name>
            </m:properties>
        </content>
    </entry>
</feed>

Read Product Additional IDs

You can retrieve product additional IDs using entity set AdditionalIDs and parameter $filter as shown below:

Request GET /sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/AdditionalIDs?$filter=ProductID eq 'Z1422224'
Response
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/">
    <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/AdditionalIDs</id>
    <title type="text">AdditionalIDs</title>
    <updated>2020-07-30T13:12:41Z</updated>
    <author>
        <name/>
    </author>
    <link href="AdditionalIDs" rel="self" title="AdditionalIDs"/>
    <entry>
        <id>https://<host>/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/AdditionalIDs(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',AdditionalProductOrigin='SAP_C4C_PRODUCT',AdditionalProductID='407901109D5FBCF31500B0E4B2FD1696')</id>
        <title type="text">AdditionalIDs(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',AdditionalProductOrigin='SAP_C4C_PRODUCT',AdditionalProductID='407901109D5FBCF31500B0E4B2FD1696')</title>
        <updated>2020-07-30T13:12:41Z</updated>
        <category term="API_MKT_PRODUCT_SRV.AdditionalID" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
        <link href="AdditionalIDs(ProductOrigin='SAP_HYBRIS_PRODUCT',ProductID='Z1422224',AdditionalProductOrigin='SAP_C4C_PRODUCT',AdditionalProductID='407901109D5FBCF31500B0E4B2FD1696')" rel="self" title="AdditionalID"/>
        <content type="application/xml">
            <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                <d:ProductOrigin>SAP_HYBRIS_PRODUCT</d:ProductOrigin>
                <d:ProductID>Z1422224</d:ProductID>
                <d:AdditionalProductOrigin>SAP_C4C_PRODUCT</d:AdditionalProductOrigin>
                <d:AdditionalProductID>407901109D5FBCF31500B0E4B2FD1696</d:AdditionalProductID>
            </m:properties>
        </content>
    </entry>
</feed>

Delete Product

The OData API does not allow you to delete the product data directly from the system. You will get an HTTP 500 error with a message showing that the operation is not supported (which you can see from the Message Monitor application in Cloud Integration), if you try to delete it.

Request
<?xml version='1.0' encoding='UTF-8'?>
<batchParts>
    <batchChangeSet>
        <batchChangeSetPart>
            <method>DELETE</method>
            <uri>ProductOriginDataSet(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT')</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-07-23T06:34:13</headerValue>
                </header>
            </headers>
        </batchChangeSetPart>
    </batchChangeSet>
</batchParts>
Response
<batchPartResponse>
    <batchChangeSetResponse>
        <batchChangeSetPartResponse>
            <headers>
                <Accept></Accept>
                <Accept-Language></Accept-Language>
                <Content-Length>1376</Content-Length>
                <dataserviceversion>1.0</dataserviceversion>
                <Content-Type>application/xml;charset=utf-8</Content-Type>
            </headers>
            <statusInfo>Internal Server Error</statusInfo>
            <contentId/>
            <body>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;error xmlns=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&quot;&gt;&lt;code&gt;/IWBEP/CM_MGW_RT/027&lt;/code&gt;&lt;message xml:lang=&quot;en&quot;&gt;Operation &apos;DELETE&apos; not supported for entity type &apos;ProductOriginData&apos;&lt;/message&gt;&lt;innererror&gt;&lt;application&gt;&lt;component_id&gt;CEC-MKT-DM-PRO&lt;/component_id&gt;&lt;service_namespace&gt;/SAP/&lt;/service_namespace&gt;&lt;service_id&gt;API_MKT_PRODUCT_SRV&lt;/service_id&gt;&lt;service_version&gt;0002&lt;/service_version&gt;&lt;/application&gt;&lt;transactionid&gt;b6d2adb8d4e24781b1d76ae215b65886&lt;/transactionid&gt;&lt;timestamp&gt;20200727081849.1376620&lt;/timestamp&gt;&lt;Error_Resolution&gt;&lt;SAP_Transaction&gt;For backend administrators: use ADT feed reader &quot;SAP Gateway Error Log&quot; or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details&lt;/SAP_Transaction&gt;&lt;SAP_Note&gt;See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)&lt;/SAP_Note&gt;&lt;Batch_SAP_Note&gt;See SAP Note 1869434 for details about working with $batch (https://service.sap.com/sap/support/notes/1869434)&lt;/Batch_SAP_Note&gt;&lt;/Error_Resolution&gt;&lt;errordetails&gt;&lt;errordetail&gt;&lt;code&gt;/IWBEP/CX_MGW_TECH_EXCEPTION&lt;/code&gt;&lt;message&gt;Operation &apos;DELETE&apos; not supported for entity type &apos;ProductOriginData&apos;&lt;/message&gt;&lt;propertyref/&gt;&lt;severity&gt;error&lt;/severity&gt;&lt;target/&gt;&lt;transition&gt;false&lt;/transition&gt;&lt;/errordetail&gt;&lt;/errordetails&gt;&lt;/innererror&gt;&lt;/error&gt;</body>
            <statusCode>500</statusCode>
        </batchChangeSetPartResponse>
    </batchChangeSetResponse>
</batchPartResponse>

If you look into the body XML response, you can see the error detail below:

<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code>/IWBEP/CM_MGW_RT/027</code>
    <message xml:lang="en">Operation 'DELETE' not supported for entity type 'ProductOriginData'</message>
    <innererror>
        <application>
            <component_id>CEC-MKT-DM-PRO</component_id>
            <service_namespace>/SAP/</service_namespace>
            <service_id>API_MKT_PRODUCT_SRV</service_id>
            <service_version>0002</service_version>
        </application>
        <transactionid>b6d2adb8d4e24781b1d76ae215b65886</transactionid>
        <timestamp>20200727081849.1376620</timestamp>
        <Error_Resolution>
            <SAP_Transaction>For backend administrators: use ADT feed reader "SAP Gateway Error Log" or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details</SAP_Transaction>
            <SAP_Note>See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)</SAP_Note>
            <Batch_SAP_Note>See SAP Note 1869434 for details about working with $batch (https://service.sap.com/sap/support/notes/1869434)</Batch_SAP_Note>
        </Error_Resolution>
        <errordetails>
            <errordetail>
                <code>/IWBEP/CX_MGW_TECH_EXCEPTION</code>
                <message>Operation 'DELETE' not supported for entity type 'ProductOriginData'</message>
                <propertyref/>
                <severity>error</severity>
                <target/>
                <transition>false</transition>
            </errordetail>
        </errordetails>
    </innererror>
</error>

Delete Product via Application Job

To delete products, you need to schedule a background job using Products: Delete Products template via the Application Jobs application in SAP Marketing Cloud. It will only delete the products if the corresponding interactions already removed from the system. Otherwise, you will get the following error:

It is always better to set the job in Test Mode before making it to Productive Mode to ensure the job deletes only those products you intend to delete. You may want to refer to this SAP Help Portal documentation to understand how you can set some of the important parameters of the job. 

Delete Product Category Assignments

If you don't intend to delete all the product category assignments of a product using function import DeleteProductCategoryAssignments as mentioned in the Update Product section, you can delete a specific product category assignment using DELETE operation on the entity set ProductCategoryAssignments as shown below:

Request Message Payload Example for Delete Product Category Assignments
<?xml version='1.0' encoding='UTF-8'?>
<batchParts>
    <batchChangeSet>
        <batchChangeSetPart>
            <method>DELETE</method>
            <uri>ProductCategoryAssignments(ProductID='Z1422224',ProductOrigin='SAP_HYBRIS_PRODUCT',ProductCategoryHierarchyID='electronicsProductCatalog:Online',ProductCategoryID='827')</uri>
            <headers>
                <header>
                    <headerName>Sap-Cuan-SequenceId</headerName>
                    <headerValue>SAP_HYBRIS_PRODUCT</headerValue>
                </header>
                <header>
                    <headerName>Sap-Cuan-RequestTimestamp</headerName>
                    <headerValue>2020-07-23T06:34:13</headerValue>
                </header>
            </headers>
        </batchChangeSetPart>
    </batchChangeSet>
</batchParts>

This is the only entity set in the product OData API that supports the DELETE operation.

Conclusion

Product data is one of the main master data which is required to be set up correctly before you can use SAP Marketing Cloud operationally. To import product data to SAP Marketing Cloud, you can either do it manually as a file upload using the Data File Load application or through product OData API. To create products using the OData API, you need to set up a communication arrangement as prerequisite.

If the standard integration package is available, it is recommended that you use the standard product integration flow or enhance it using pre-exit and post-exit integration flows. In the event you have to develop a custom integration flow, you need to make yourself familiar with the OData APIs. While designing the integration flow to handle different possible scenarios, please refer to the considerations highlighted in this article.

Do you want to learn even more about the integration aspect of SAP Marketing Cloud? While we are going to release more articles related to this subject in the future, please also look into the already published articles below:

Overlay