Skip to Content
author's profile photo Former Member
Former Member

Inserting data into Hybris using OData interface - Error while parsing an XML stream

We have some issues when utilizing the “Product” entity within Hybris.

Getting an error that says ‘Error while parsing an XML stream’ when trying to import data into Hybris using the OData interface.

Here’s a link to what the request looks like that I’m sending to Hybris:

If I take that same request but delete the “Products.Quantity” and “Products.Amount”, it works without any problems. So it must be with how I’m sending those two fields. I checked the interface guide for our version of Hybris, and it says those two fields should exist on “InteractionProduct”. Am I misreading how those fields should be used? Or maybe that “Products” array isn’t mapping properly to “InteractionProduct”? Any guidance would be helpful since ‘Error while parsing an XML stream’ is a completely useless error message.

Hoping you can assist or point us in the right direction.

Add a comment
10|10000 characters needed characters exceeded

  • Hi Andrew,

    Sample payload for sending the SALES_ORDER with products is as follow:

    	"Id": "",
    	"Timestamp": "2016-01-14T16:57:43.1190000",
    	"UserName": "",
    	"SourceSystemType": "",
    	"SourceSystemId": "SAP_MERCH_SHOP",
    	"Interactions": [{
    		"ContactIdOrigin": "SAP_HYBRIS_MKT_IC",
    		"ContactId": "02000A1BA8A81ED781ADBE13368CCA99",
    		"CommunicationMedium": "BUSINESS_DOCUMENT",
    		"InteractionType": "SALES_ORDER",
    		"SourceObjectId": "SAP_HYBRIS_COMMERCE",
    		"Timestamp": "2017-05-14T16:57:44.1190000",
    		"Valuation": 5,
    		"Amount": "300.30",
    		"Currency": "EUR",
    		"Products": [{
    				"ItemType": "SAP_HYBRIS_PRODUCT",
    				"ItemId": "PH001",
    				"Amount": "200",
    				"Quantifier": 1,
    				"Quantity": "1",
    				"UnitOfMeasure": "EA"
    				"ItemType": "SAP_C4C_PRODUCT",
    				"ItemId": "P300403",
    				"Amount": "100.30",
    				"Quantifier": 1,
    				"Quantity": "1",
    				"UnitOfMeasure": "EA"



Assigned Tags

Related questions

1 Answer

  • Posted on Sep 02, 2017 at 03:13 PM

    Hello Andrew,

    please try with putting the amount value in double quotes:

    "Amount" : "13394.8"

    The amount is sent as JSON string - according to OData json format documentation the double value must use quotes (") because double are formatted as a JSON string.

    best regards,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.