/scripts/ahub.form.attachments.js
0

Hybris Marketing Import via OData Service

Jul 06 at 09:24 AM

75

avatar image

Hi together,

I'm trying to import sales orders to hybris marketing via the OData Service CUAN_IMPORT_SRV.

I'm using postman and json file ("CommunicationMedium" : "BUSINESS_DOCUMENT",

"InteractionType" : "SALES_ORDER").

When I add an "ImageURL" with the URL from our Hybris Commerce Webshop I get the error message Bad Syntax.

Also, I don't understand why I have to add "Amout" under Interactions AND under Products, otherwise I also get the error message Bad Syntax.

Can someone explain where the fields "Amount", "Currency", "Quantity" and "UnitOfMeasure" have to be in the json file.

Here I can just find information about the upload of interactions in general but his is working very well: https://cp.hana.ondemand.com/dps/d/preview/3f07b8545988b409e10000000a423f68/1603%20500/en-US/60ff8b5544fdbf5de10000000a423f68.html

It would be great if someone can post a json example for a manual sales order import.

Thank you & regards

Tobias

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Christopher Günther Jul 12 at 07:45 AM
0

Hi Tobias,

some time ago I was trying similar. The post request to http://yourserver:8000/sap/opu/odata/SAP/cuan_import_srv/ImportHeaders I used had the following JSON:

{
  "Id" : "",
  "Timestamp" : "/Date(1498435200)/",
  "UserName" : "yourUser",
  "SourceSystemId" : "local",
  "Interactions" : [
    {
      "Key" : "",
      "CampaignId" : "",
      "CommunicationMedium" : "BUSINESS_DOCUMENT",
      "ContactId" : "userID",
      "ContactIdOrigin" : "SAP_HYBRIS_CONSUMER",
      "ContentData" : "",
      "ContentTitle" : "",
      "InitiativeId" : "",
      "InitiativeVersion" : 0,
      "InteractionType" : "SALES_ORDER",
      "IsAnonymous" : false,
      "MarketingOrchestrationId" : 0,
      "Quantifier" : 1,
      "SourceDataUrl" : "",
      "SourceObjectId" : "",
      "SourceObjectType" : "SAP_HYBRIS_ORDER",
      "SourceSystemId" : "",
      "SourceSystemType" : "",
      "StartingPointUrl" : "",
      "StartingPointText" : "",
      "Timestamp" : "/Date(1498435200)/",
      "Valuation" : 0,
      "Currency" : "USD",
      "Amount" : "54.0",
      "Products" : [
        {
          "Key" : "",
          "ItemId" : "D940000S0000",
          "SourceSystemId" : "hybris Web Shop 1",
          "ItemType" : "SAP_HYBRIS_PRODUCT"
        }
      ]
    }
  ]
}

you would have to adjust the contact ID, timesptamps, item id, etc.

To check where are certain attributes I am using transaction "segw" and then I filter for projects "CUAN*". e.g. attributes "Amount" and "Currency" are under Interactions.

Regards Christopher.


Show 6 Share
10 |10000 characters needed characters left characters exceeded

Hi Christopher,

thank you!

But at which point in your json do you tell the system the amount and the currency of the bought product?

Regards

Tobias

0

Hi Tobias,

I updated my JSON. Executing it will lead to an entry in table CUAND_CE_IA_RT. You could supply additional values for e.g. SourceObjectId, which would be the order number of yCommerce.

Regards Christopher.

1

Hi Christopher,

thank you very much! Makes it easier to understand the logic. :-)

What is then the meaning of the AMOUNT field in the CUAND_CE_IA_PROD if I only need the entry in the CUAND_CE_IA_RT to show the sales order in the interactions-facet?

Do you have an idea where the error "bad syntax" is coming from when adding an image url to the product? Have you tested it for your json if it works?

And do you know if it is important whether I use the CUAN_IMPORT_SRV or the CUAN_BUSINESS_DOCUMENT_IMP_SRV? Because Hybris Commerce usually uses the second one but that service is not working, there's always an error message "no authorization" in the /IWFND/ERROR_LOG though I have SAP_ALL.

Again thank you for the exchange! :-)

Regards Tobias

0

Hi Tobias,

I added an ImageUrl field in the product above and it's working fine for me. I am not receiving any error message.

As for the CUAND_CE_IA_RT table I think the amount is referring to the amount of the order, while the in CUAND_CE_IA_PROD for each record is referring to the price of the individual item within your order.

You are right. I also just noticed that expressway is using the service CUAN_BUSINESS_DOCUMENT_IMP_SRV. Currently I can't work out what role makes our communication user able to use this service.

I guess we need some information from the expert :)

Regards Christopher.

0
Christopher Günther

Hi Christopher,

okay, thank you. Because of some other errors I've done a new client copy and actually doing a new configuration of my system. Maybe also the upload will work after that.

If I get some information about the services I will let you know :-)

Regards Tobias

0
Christopher Günther

Hi Christopher,

you have to add the role SAP_CEI_C4C_INTEGRATION to your communication user. This role is usually needed for the integration with C4C but it's also working for the communication with the hybris commerce shop. I've tested it and it's working fine :)

Regards Tobias

1
Skip to Content