November Happy Hour will be moved to Thursday December 5th.

Commerce ServiceApi - Unable to update orgnanization

Vote:
 

Hi, 

I setup the ServiceApi for commerce in order to maintain customer (Organization/Contact) using the endpoint described here Customers' endpoints.

Reading customers works perfect but when trying to write, I face the following issues:

  • If I GET an organization, update the address (or any other fields) then POST it back, I get HTTP 201 (Created) which seems fine but when I read it back, nothing has been updated.
  • If I GET an organization, replace its PrimaryKeyId with a new GUID then POST it BACK, I get HTTP 201 but this time a new Organization is created as expected but none of its properties are set (expect the PrimaryKeyId).
  • If I do a request PUT instead of POST I get HTTP 405 (Method not allowed).

Any clue on what's going wrong ?

On a side note, I find it confusing that I have to use my own Address and Organization classes to have a deserialization working. Why does the Mediachase.Commerce.Customers.Organization and Mediachase.Commerce.Customers.CustomerAddress can be used instead.

Thanks,

David

#195976
Aug 14, 2018 15:55
Vote:
 

Re your second question - try to deserialize those classes and you'll see why. They are complicated and contains unnecessary information that does not fit for ServiceAPI serialization/deserialization.

Re your first question - updating organization is now limited to OrganizationType and OrgCustomerGroup. The other properties are planned to be supported in the future. Perhaps we should be more clear about it. 

#195989
Aug 15, 2018 9:47
Vote:
 

I just published a blog post of some code I wrote for a couple of other partners if you need to be able to update other properties

https://world.episerver.com/blogs/Mark-Hall/Dates/2018/6/serviceapi-customers-and-organizations-extended/

#196010
Aug 15, 2018 21:06
Vote:
 

Thanks guys.

#196318
Aug 24, 2018 15:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.