Prestashop API Create Product

0

I have a case in which wanting to create a product through the prestashop API gives me error 500

I create the creation through POST The URL is: link

This is the XML that is sent

<?xml version="1.0" encoding="utf-8"?>
<prestashop xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <product>
    <id />
    <reference>TR3DE</reference>
    <id_category_default>30</id_category_default>
    <available_for_order>1</available_for_order>
    <show_price>1</show_price>
    <price>0.000000</price>
    <active>1</active>
    <id_tax_rules_group>1</id_tax_rules_group>
    <ean13 />
    <id_supplier />
    <supplier_reference />
    <is_virtual />
    <id_shop_default />
    <weight />
    <id_manufacturer />
    <type />
    <width />
    <depth />
    <quantity_discount />
    <on_sale />
    <online_only />
    <ecotax />
    <minimal_quantity />
    <wholesale_price />
    <unity />
    <unit_price_ratio />
    <additional_shipping_cost />
    <customizable />
    <condition />
    <indexed />
    <visibility />
    <advanced_stock_management />
    <date_add />
    <date_upd />
    <height />
    <position_in_category>0</position_in_category>
    <cache_is_pack>0</cache_is_pack>
    <pack_stock_type />
    <name>
      <language id="1">Windsurfing Tricktionary 3 Edit. Deutsch</language>
    </name>
    <description>
      <language id="1" />
    </description>
    <description_short>
      <language id="1"><![CDATA[Windsurfing Tricktionary 3 Edit. Deutsch]]></language>
    </description_short>
    <meta_title>
      <language id="1" />
      <language id="4" />
      <language id="5" />
    </meta_title>
    <meta_keywords>
      <language id="1" />
      <language id="4" />
      <language id="5" />
    </meta_keywords>
    <meta_description>
      <language id="1" />
      <language id="4" />
      <language id="5" />
    </meta_description>
    <link_rewrite>
      <language id="1">TR3DE</language>
    </link_rewrite>
    <associations><categories>
      <category>
        <id>30</id>
      </category>
      <category>
        <id>147</id>
      </category>
    </categories>
    <product_bundle /></associations>
  </product>
</prestashop>

what can it be?

    
asked by IcuScc 27.12.2017 в 16:16
source

2 answers

0

The problem was that you were using a language id that did not exist

    
answered by 15.10.2018 / 20:16
source
1

Enables debug mode in the prestashop webservice class and executes the call to the API using the browser. I should give you more information about error 500. Besides that you have 4 languages and you only send the link rewrite of id lang 1.

    
answered by 15.10.2018 в 18:31