Jump to content

PS 1.6.1.6 - API - PUT clears any fields not included


josegrad

Recommended Posts

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

18 minutes ago, hakeryk2 said:

 

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...