Jump to content

Web Service Product Quantity Update Issue


Recommended Posts

Hello,

 

 I have created the shops using Prestashop version 1.6.1.0. Everything is working fine except the product quantity is not getting updated via webservice call. We have integrated it with Unicommerce as well, whenever they are trying to synch the inventory for products it is returning blank response. 

 

 To test the same i have created webservice client using PrestashopWebserviceCall.php. I am able to reterieve, delete products using it but whenever i am trying to update the product quantity or adding new product, it is returning an error stating BAD ID.. 

 

You can check the response XML as well as exception message below:

 

RETURN HTTP BODY
<?xml version="1.0" encoding="UTF-8"?><prestashop xmlns:xlink="http://www.w3.org/1999/xlink"><errors><error><code><![CDATA[93]]></code><message><![CDATA[parameter "manufacturer_name" not writable. Please remove this attribute of this XML]]></message></error></errors></prestashop>

object(PrestaShopWebserviceException)#3 (6) { ["message:protected"]=> string(104) "This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request." ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(67) "/home/samplewo/public_html/PSWebserviceCall/PSWebServiceLibrary.php" ["line:protected"]=> int(91) ["trace:private"]=> array(2) { [0]=> array(6) { ["file"]=> string(67) "/home/samplewo/public_html/PSWebserviceCall/PSWebServiceLibrary.php" ["line"]=> int(359) ["function"]=> string(15) "checkStatusCode" ["class"]=> string(20) "PrestaShopWebservice" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> int(400) } } [1]=> array(6) { ["file"]=> string(63) "/home/samplewo/public_html/PSWebserviceCall/examples/Update.php" ["line"]=> int(72) ["function"]=> string(4) "edit" ["class"]=> string(20) "PrestaShopWebservice" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> array(3) { ["resource"]=> string(8) "products" ["putXml"]=> string(2412) " 105 0 0 2 0 08 10 simple 1 AA123 0.000000 0.000000 0.000000 0.000000 0 0 0 0 0 0 0.000000 1 0.000000 0.000000 0.000000 0.00 0 0 0 1 404 0 1 0000-00-00 new 1 1 both 0 2015-11-21 10:00:17 2015-11-21 10:24:40 3 " ["id"]=> string(3) "105" } } } } } Other error
This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request.

 
Please look into this matter as updating inventory is an essential feature and using webservice it is not happening. 
 
Looking forward for quick response.
 
Thanks and Regards
   Sumit Bhatia
Link to comment
Share on other sites

PFB, the XML Sent... 

 

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<product>
    <id>105</id>
    <id_manufacturer>0</id_manufacturer>
    <id_supplier>0</id_supplier>
    <id_category_default xlink:href="http://www.itechkart.com/api/categories/2">2</id_category_default>
    <new></new>
    <cache_default_attribute>0</cache_default_attribute>
    <id_default_image notFilterable="true"></id_default_image>
    <id_default_combination notFilterable="true"></id_default_combination>
    <id_tax_rules_group>0</id_tax_rules_group>
    <position_in_category notFilterable="true">8</position_in_category>
    <manufacturer_name notFilterable="true"></manufacturer_name>
    <quantity notFilterable="true">10</quantity>
    <type notFilterable="true">simple</type>
    <id_shop_default>1</id_shop_default>
    <reference>AA123</reference>
    <supplier_reference></supplier_reference>
    <location></location>
    <width>0.000000</width>
    <height>0.000000</height>
    <depth>0.000000</depth>
    <weight>0.000000</weight>
    <quantity_discount>0</quantity_discount>
    <ean13></ean13>
    <upc></upc>
    <cache_is_pack>0</cache_is_pack>
    <cache_has_attachments>0</cache_has_attachments>
    <is_virtual>0</is_virtual>
    <on_sale>0</on_sale>
    <online_only>0</online_only>
    <ecotax>0.000000</ecotax>
    <minimal_quantity>1</minimal_quantity>
    <price>0.000000</price>
    <wholesale_price>0.000000</wholesale_price>
    <unity></unity>
    <unit_price_ratio>0.000000</unit_price_ratio>
    <additional_shipping_cost>0.00</additional_shipping_cost>
    <customizable>0</customizable>
    <text_fields>0</text_fields>
    <uploadable_files>0</uploadable_files>
    <active>1</active>
    <redirect_type>404</redirect_type>
    <id_product_redirected>0</id_product_redirected>
    <available_for_order>1</available_for_order>
    <available_date>0000-00-00</available_date>
    <condition>new</condition>
    <show_price>1</show_price>
    <indexed>1</indexed>
    <visibility>both</visibility>
    <advanced_stock_management>0</advanced_stock_management>
    <date_add>2015-11-21 10:00:17</date_add>
    <date_upd>2015-11-21 10:24:40</date_upd>
    <pack_stock_type>3</pack_stock_type>
    <meta_description></meta_description>
    <meta_keywords></meta_keywords>
    <meta_title></meta_title>
    <link_rewrite></link_rewrite>
    <name></name>
    <description></description>
    <description_short></description_short>
    <available_now></available_now>
    <available_later></available_later>
<associations></associations>
</product>
</prestashop>

Link to comment
Share on other sites

×
×
  • Create New...