Commerce ServiceApi - Unable to update orgnanization



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.



#195976 Aug 14, 2018 15:55
  • Quan Mai
    Member since: 2011

    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
  • Mark Hall
    Member since: 2011

    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

    #196010 Aug 15, 2018 21:06

    Thanks guys.

    #196318 Aug 24, 2018 15:47