prestashop webservices create order



I'm trying to create order in Prestashop 1.6.0.14. Client, address, carsare created successful but I can't create order and don't know why. Here is code for order creation:



$webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG);
$xml = new SimpleXMLElement($psXML);
$opt = array( 'resource' => 'orders' );
$opt['postXml'] = $xml->asXML();
$xml = $webService->add( $opt );


and here is XML Im passing:



<?xml version="1.0" encoding="UTF-8"?>
<prestashop>
<order>
<id_address_delivery>175</id_address_delivery>
<id_cart>286</id_cart>
<id_currency>1</id_currency>
<id_lang>1</id_lang>
<id_customer>191</id_customer>
<id_carrier>8</id_carrier>
<current_state>14</current_state>
<module>Bankwire</module>
<date_add>2015-04-18 11:04:42</date_add>
<id_shop_group>1</id_shop_group>
<id_shop>1</id_shop>
<payment>przelew na konto</payment>
<total_discounts>0.00</total_discounts>
<total_discounts_tax_incl>0.00</total_discounts_tax_incl>
<total_discounts_tax_excl>0.00</total_discounts_tax_excl>
<total_paid>60.5</total_paid>
<total_paid_tax_incl>60.5</total_paid_tax_incl>
<total_paid_tax_excl>46.2</total_paid_tax_excl>
<total_paid_real>60.5</total_paid_real>
<total_products>44</total_products>
<total_products_wt>44</total_products_wt>
<total_shipping>16</total_shipping>
<total_shipping_tax_incl>16</total_shipping_tax_incl>
<total_shipping_tax_excl>12.32</total_shipping_tax_excl>
<carrier_tax_rate>1</carrier_tax_rate>
<total_wrapping>0.00</total_wrapping>
<total_wrapping_tax_incl>0.00</total_wrapping_tax_incl>
<total_wrapping_tax_excl>0.00</total_wrapping_tax_excl>
<round_mode>2</round_mode>

</order>
</prestashop>


Im getting error:



Internal error. To see this error please display the PHP errors.

Other error

This call to PrestaShop Web Services failed and returned an HTTP status of 400.

That means: Bad Request.



Can anybody help mi with that? I'm searching help on google, forums, stack, and nothing. I really need this to finally be able to import orders from allegro to prestashop.


No comments:

Post a Comment