Jump to content

Can't update specific price with webservice


peha_danbit

Recommended Posts

I'm using the webservice for updating prices and it works fine when I'm creating a new specific price for a product, but I get an error when I try to update an existing one.

 

This is the xml that is sent:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<specific_prices>
<specific_price>
	<id><![CDATA[11083]]></id>
	<id_shop_group><![CDATA[0]]></id_shop_group>
	<id_shop><![CDATA[0]]></id_shop>
	<id_cart><![CDATA[0]]></id_cart>
	<id_product xlink:href="http://domain.com/api/products/8818"><![CDATA[8818]]></id_product>
	<id_product_attribute><![CDATA[0]]></id_product_attribute>
	<id_currency><![CDATA[0]]></id_currency>
	<id_country><![CDATA[0]]></id_country>
	<id_group><![CDATA[0]]></id_group>
	<id_customer><![CDATA[0]]></id_customer>
	<id_specific_price_rule><![CDATA[0]]></id_specific_price_rule>
	<price><![CDATA[115]]></price>
	<from_quantity><![CDATA[6]]></from_quantity>
	<reduction><![CDATA[0.000000]]></reduction>
	<reduction_type><![CDATA[amount]]></reduction_type>
	<from><![CDATA[0000-00-00 00:00:00]]></from>
	<to><![CDATA[0000-00-00 00:00:00]]></to>
</specific_price>
</specific_prices>
</prestashop>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<errors>
<error>
<code><![CDATA[90]]></code>
<message><![CDATA[id is required when modifying a resource]]></message>
</error>
</errors>
</prestashop>

Which ID is the response referring to, since the price id is set?

Edited by peha_danbit (see edit history)
Link to comment
Share on other sites

  • 3 months later...

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...