cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Invalid value '-xxxx' for attribute 'PRODUCT_CATEGORY' while creating interaction in Marketing cloud

former_member601733
Participant
0 Kudos
876

Hi All,

In SAP Marketing cloud , i am trying to create a interaction with product details. When i am passing only the product id then the interaction is created with the product category details. When i try to pass the product category as one field then i am getting the invalid value error.

Sample payload. Check and confirm if i need to send any other data

{
"InteractionContactOrigin":"Zxxxxx",
"InteractionContactId":"239",
"InteractionType":"SHOP_ITEM_VIEW",
"CommunicationMedium":"ZONLINE_WEBSITE_xxxx",
"InteractionSourceDataURL":"https://www.abcdefg.com",
"InteractionSourceObjectType":"WEB_SESSION",
"InteractionSourceObject":"1831425",
"InteractionTimeStampUTC":"2019-07-02T12:00:00",
"MarketingArea":"xxxx",
"SourceSystemType":"xxxxxx",
"InteractionProducts":[{
"ProductOrigin":"xxxxxxx",
"Product":"xxxxxx"
}],

"InteractionProductCategories":[{

"ProductCategory":"xxxxxxx"

}]
}

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee
0 Kudos

Hi,

While adding "ProductCategory" to the payload you have to also pass "ProductCategoryHierarchy" as well mandatorily and both are case sensitive. if you just pass ProductCategory then system is unable to identify the hierarchy it belongs to hence the error you get in response.

Pls refer the sample payload to be used:

{
	"InteractionContactOrigin": "EMAIL",
	"InteractionContactId": "xxxxxx@xxx.com",
	"InteractionTimeStampUTC": "2019-07-11T09:41:50",
	"InteractionSourceObjectType": "ERP",
	"InteractionSourceObject": "12345678",
	"CommunicationMedium": "ONLINE_SHOP",
	"InteractionType": "SHOP_ITEM_VIEW",
	"InteractionCurrency":"EUR",
	"InteractionProductCategories":[{
		"ProductCategory":"HARDWARE",
		"ProductCategoryHierarchy":"root"
	}],
	"InteractionProducts": [
		{
			"ProductOrigin": "SAP_HYBRIS_PRODUCT",
			"Product": "478828",
			"InteractionProductAmount": "99.99",
			"InteractionProductQuantity": "1",
			"InteractionProductUnit": "m"
		},
		{
			"ProductOrigin": "SAP_HYBRIS_PRODUCT",
			"Product": "478332",
			"InteractionProductAmount": "99.99",
			"InteractionProductQuantity": "1",
			"InteractionProductUnit": "m"
		}
	]
}

Thanks

Saurabh

Answers (1)

Answers (1)

KunalBansal
SAP Champion
SAP Champion

Dear Selvam,

Please check the detailed explanation of how to use the Marketing Product API.

You can adjust your OData call accordingly.

Kind Regards,

Kunal Bansal

SAP Marketing Cloud, Consultant