Storeden Help Center

Welcome,
search through the guides and find what you need.

Adding a product via XML

Follow

To add a product to your online shop, you need to generate an XML feed in this format:

Source

<urn:products xsi:type="urn:Item">
  <product>
    <groupUID xsi:type="xsd:integer">30</groupUID>
    <category xsi:type="xsd:string">DONNA#SCARPE</category>
    <brand xsi:type="xsd:string">Acme Inc.</brand>
    <title xsi:type="xsd:string">Titolo del prodotto di esempio</title>
    <facebookenable>1</facebookenable>
    <description xsi:type="xsd:string">
      <![CDATA[<p>Descrizione del prodotto, anche in html</p>]]>
    </description>
    <taxable xsi:type="xsd:integer">0</taxable>
    <quantity xsi:type="xsd:integer">10</quantity>
    <price xsi:type="xsd:float">259.00</price>
    <discount xsi:type="xsd:integer">10</discount>
    <weight xsi:type="xsd:integer">1</weight>
    <volume>
      <w xsi:type="xsd:integer">15</w>
      <h xsi:type="xsd:integer">30</h>
      <z xsi:type="xsd:integer">100</z>
    </volume>
    <highview xsi:type="xsd:integer">0</highview>
    <sku xsi:type="xsd:string">TRACK_19aBN</sku>
    <images>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00001.jpg</image>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00002.jpg</image>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00003.jpg</image>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00004.jpg</image>
    </images>
    <var>
      <variation>
        <var_composite>
          <key xsi:type="xsd:string">37</key>
          <count xsi:type="xsd:integer">2</count>
          <price xsi:type="xsd:float">0</price>
          <sku xsi:type="xsd:string">CRS0025_NERO_37</sku>
        </var_composite>
        <var_composite>
          <key xsi:type="xsd:string">38</key>
          <count xsi:type="xsd:integer">1</count>
          <price xsi:type="xsd:float">0</price>
          <sku xsi:type="xsd:string">CRS0025_NERO_38</sku>
        </var_composite>
      </variation>
      <var_key>
        <var_name xsi:type="xsd:string">Taglia</var_name>
        <var_value>
          <value xsi:type="xsd:string">37</value>
          <value xsi:type="xsd:string">38</value>
          <value xsi:type="xsd:string">39</value>
        </var_value>
      </var_key>
    </var>
  </product>
</urn:products>

Inside the <urn:products> tag, you can add the product's feed.

Notes

The SKU code is the primary key of the product. Each update will be performed using the product's code.

GroupUID

Store ID when updating products.

Taxes

The <taxable> tag identifies whether the product's price includes sales tax or not (0 => Tax included in the price; 1 => Tax excluded).

Item discount

The <discount> tag identifies whether a discount should be applied before its displayed or not. Only integers can be entered in this field. If set to 0, no discount will be applied.

Categories

Enter the category tree separated by #. If there is no category tree, it will be created.

Dimensions

The dimensions entered in the XML feed refer to the packaging. They are used to calculate shipping costs (W => Length, H => Height, Z => Width).

Variants

For product variants, the quantity of the product available for purchase by consumers is set in the <count> tag in the <var_composite> structure. As result, the<quantity> field will be ignored. If the product does not have variants, the <var> tag and all its content can be omitted from the feed; the available quantity will be managed by the <quantity> tag.

PHP

<?
$xml_params = file_get_contents('products_feed.xml');
$headers = array(
  "Content-type: text/xml;charset=\"utf-8\"",
  "Accept: text/xml",
  "Cache-Control: no-cache",
  "Pragma: no-cache"
);

$auth_user = 'YourEmail';
$auth_password = 'YourPassword';

/** PRECHECK **/
if ($auth_user == '' || $auth_password == '') {
  throw new Exception('No Auth key found');
}

$url = 'http://ws.storeden.com/external/postproduct';

$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0) ;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'StoredenExternalApi');
curl_setopt($ch, CURLOPT_USERPWD, $auth_user.":".$auth_password);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$str_result = curl_exec($ch);

curl_close($ch);
?>

CURL

Coming soon! Once the feed upload is complete, the system will process the feed in background.

Was this article helpful?
0 out of 0 found this helpful

Comments

Don't wait, start now to sell with Storeden

Try it for free