josegrad Posted May 30, 2018 Share Posted May 30, 2018 I'm on Prestashop 1.6.1.6 I need to update the shipping_number of an order. For that I'm using: PUT to http://SN...7C@localhost:8888/prestashop1616/api/orders If I send: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <order> <id>5</id> <shipping_number notFilterable="true">1234567890</shipping_number> </order> </prestashop> The response is: parameter "id_address_delivery" required ------- So apparently the request requires ALL the fields of the object, some of them are mandatory, which can be ok to some extent. But other that are not mandatory, if omitted, their values are cleared from the original data. To me that doesn't make much sense, it behaves as a POST and not as a PUT. Having to send ALL the data over is a needless risk in my opinion. Is this behaviour a bug of 1.6.1.6? Also this PUT create a new order_history object, which again I'm not sure it makes much sense. Link to comment Share on other sites More sharing options...
josegrad Posted June 6, 2018 Author Share Posted June 6, 2018 No one? Has anyone tried setting the shipping number via Webservice, by just sending the shipping_number field, on a more recent version? Link to comment Share on other sites More sharing options...
hakeryk2 Posted June 11, 2018 Share Posted June 11, 2018 Maybe something like this? https://www.prestashop.com/forums/topic/624317-example-of-jqueryjavascript-api-request-which-will-edit-something-in-order/ Link to comment Share on other sites More sharing options...
josegrad Posted June 11, 2018 Author Share Posted June 11, 2018 18 minutes ago, hakeryk2 said: Maybe something like this? https://www.prestashop.com/forums/topic/624317-example-of-jqueryjavascript-api-request-which-will-edit-something-in-order/ Thanks for your reply hakeryk2 I'm accessing the Webservice from Ruby, not form javascript. But in that post it says "then PUT the whole XML file back to the same URL again" The whole XML. So it looks like it behaves that same way. Probably there's nothing that can be done, other than sending the whole thing. Which in my opinion is an ugly thing. Link to comment Share on other sites More sharing options...
hakeryk2 Posted June 12, 2018 Share Posted June 12, 2018 Yup, that is the case. You have download everything, change something and upload it again. It is really not so efficient. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now