Shoptrader API docs

Image Description

Get - Products

Met deze API is het mogelijk om producten uit te lezen

Parameters

Parameter Type Verplicht Omschrijving
token string Ja Token, wordt verstrekt door Shoptrader op verzoek
language_id integer Nee Indien leeg toon alle talen
category_id integer Nee Indien leeg toon van alle categorie├źn
on_home integer Nee Alleen artikelen die op de home pagina staan. 0 of 1
limit integer Nee Stel een limiet in, gebruik all voor alle producten, indien leeg standaard de eerste 100
offset integer Nee Stel een offset in, om bijvoorbeelde de volgende 10 op te halen, indien leeg standaard 0
last_modified_from date Nee Alle producten die gewijzigd zijn te laten zien vanaf de datum.
last_modified_to date Nee Alle producten die gewijzigd zijn te laten zien tot de datum. Let op: last_modified_from moet hiervoor ook gevuld zijn

PHP Example

<?php
ini_set
('max_execution_time'0);

$strApiBaseUrl 'uwdomeinnaam.uwdomeinextentie';
$strOutput 'array'// default array
$strUrl 'http://' $strApiBaseUrl '/Api/Get/Products/?' $strOutput;        

// standaard parameters
$arrParams = array();
$arrParams['token']         = '8f00f89310945a0ca35666c8c9ced2e314e37aa6c32e900932e19902b42208767';

// custom parameters
$arrParams['language_id']     = 4;
$arrParams['limit']         = 1;

// $arrParams['last_modified_from'] = '18-01-2016' // '18-01-2016 12:00:00';
// $arrParams['last_modified_to'] = '18-01-2016';  // '18-01-2016 12:05:00';

$objCurl curl_init();
curl_setopt($objCurlCURLOPT_URL$strUrl);
curl_setopt($objCurlCURLOPT_RETURNTRANSFERtrue);
curl_setopt($objCurlCURLOPT_TIMEOUT30);
curl_setopt($objCurlCURLOPT_USERAGENT'Shoptrader');
curl_setopt($objCurlCURLOPT_POSTtrue);
curl_setopt($objCurlCURLOPT_POSTFIELDShttp_build_query($arrParams));

// execute cURL, array, xml output
$strCurlData curl_exec($objCurl);
if (
$strCurlData === FALSE) {
    echo 
"cURL Error: " curl_error($objCurl);
} else {
    
print_r($strCurlData);
}

// execute cURL, array, xml output
// $strCurlData = curl_exec($objCurl);
// if ($strCurlData === FALSE) {
//    echo "cURL Error: " . curl_error($objCurl);
// } else {
//    $arrShopResult = json_decode($strCurlData, true);
//    print_r($arrShopResult);
// }
?>

Resultaat (array)

Alle prijzen zijn exclusief BTW

<?php
Array (
    [
products] => Array (
        [
28] => Array (
            [@
attributes] => Array (
                [
product_id] => 28
            
)
            [
products_name] => Accessoire 4
            
[layover] => 0
            
[onHomepage] => 1
            
[isActive] => 1
            
[sort_order] => 0
            
[sort_order_home] => 0
            
[products_model] => ac104
            
[products_ean] => 
            [
products_sku] => 
            [
products_quantity] => 5
            
[products_weight] => 0.00
            
[products_price_ex] => 23.0992
            
[products_discounts] => Array (
                [
0] => Array (
                    [
ammount] => 5
                    
[price_ex] => 18
                
)
                [
1] => Array (
                    [
ammount] => 10
                    
[price_ex] => 15
                
)
                [
2] => Array (
                    [
ammount] => 15
                    
[price_ex] => 12
                
)
            )
            [
offer_price] => Array (
                [
0] => Array (
                    [
offer_price_ex] => 20.0000
                    
[offer_price_expire_date] => 2016-01-31
                    
[offer_price_status] => 1
                
)
            )
            [
products_tax] => 21.0000
            
[products_order_quantity] => 0
            
[products_quote] => 0
            
[product_available_from] => 0000-00-00 00:00:00
            
[product_available_to] => 0000-00-00 00:00:00
            
[products_free_above] => 
            [
manufacturers_id] => 
            [
manufacturers_name] => 
            [
dailyOffer] => 0
            
[length] => 0.0000
            
[width] => 0.0000
            
[date_added] => 2016-01-01 00:00:00
            
[last_modified] => 2016-01-01 00:00:00
            
[urls] => Array (
                [
dutch] => Array (
                    [
url] => multishop2.shoptrader.nl/accessoires/accessoire-4
                
)
            )
            [
products_name_languages] => Array (
                [
dutch] => Array (
                    [
name] => Accessoire 4
                
)
            )
            [
description] => Array (
                [
dutch] => Array (
                    [
description] => Array(
                        [@
cdata] => <p>Lorem ipsum dolor sit ametconsectetuer adipiscing elit.</p>
                    )
                    [
shortDescription] => Array (
                        [@
cdata] => <p>Lorem ipsum dolor sit ametconsectetuer adipiscing elit.</p>
                    )
                    [
extraInformation] => Array (
                        [@
cdata] => <p>Lorem ipsum dolor sit ametconsectetuer adipiscing elit.</p>
                    )
                )
            )
            [
meta] => Array(
                [
dutch] => Array (
                    [
products_seo_url] => accessoire-4
                    
[products_meta_title] => 
                    [
products_meta_keywords] => 
                    [
products_meta_description] => 
                )
            )
            [
images] => Array (
                [
image1] => 3005_accessoire4-1.jpg
                
[image1_alt] => 
                [
image2] => 3005_accessoire4-2.jpg
                
[image2_alt] => 
                [
image3] => 
                [
image3_alt] => 
                [
image4] => 
                [
image4_alt] => 
                [
image5] => 
                [
image5_alt] => 
                [
image6] => 
                [
image6_alt] => 
                [
image7] => 
                [
image7_alt] => 
                [
image8] => 
                [
image8_alt] => 
                [
image9] => 
                [
image9_alt] => 
                [
image10] => 
                [
image10_alt] => 
                [
image11] => 
                [
image11_alt] => 
                [
image12] => 
                [
image12_alt] =>  
            )
            [
marktplaats] => Array (
                [
products_admarkt] => 0
            
)
            [
advertentieplanet] => Array (
                [
products_advertentieplanet] => 0
            
)
            [
beslist] => Array (
                [
products_beslist] => 0
                
[products_beslist_origineel] => 1
            
)
            [
google] => Array (
                [
products_google_shopping] => 0
                
[products_google_shopping_gtin] => 0
                
[products_google_shopping_identifier_exists] => 0
            
)
            [
kieskeurig] => Array (
                [
products_kieskeurig] => 0
            
)
            [
tweakers] => Array (
                [
products_tweakers] => 0
            
)
            [
kelkoo] => Array (
                [
products_kelkoo] => 0
            
)
            [
categories] => Array (
                [
categorie] => Array (
                    [
72] => Array (
                        [@
attributes] => Array (
                            [
category_id] => 72
                        
)
                        [
is_main_category] => 1
                        
[tree] => 1_72
                        
[name] => Array (
                            [
dutch] => Array (
                                [
categories_name] => Accessoires
                            
)
                        )
                        [
seo_url] => Array (
                            [
dutch] => Array (
                                [
categories_seo_url] => accessoires
                            
)
                        )
                        [
path] => Array (
                            [
dutch] => Array (
                                [
categories_path] => Accessoires
                            
)
                        )
                    )
                )
            )
            [
features] => Array (
                [
3] => Array (
                    [@
attributes] => Array (
                        [
feature_id] => 3
                    
)
                    [
feature_id] => 3
                    
[order] => 1
                    
[feature_name] => Array (
                        [
dutch] => Array (
                            [
0] => Array (
                                [
feature] => Stof
                                
[feature_value] => Feature 2 Nieuw NL_wijzig
                            
)
                        )
                    )
                )
                [
1] => Array (
                    [@
attributes] => Array (
                        [
feature_id] => 1
                    
)
                    [
feature_id] => 1
                    
[order] => 0
                    
[feature_name] => Array (
                        [
dutch] => Array (
                            [
0] => Array (
                                [
feature] => Kleur
                                
[feature_value] => Feature Nieuw NL_wijzig
                            
)
                        )
                    )
                )
            )
            [
attributes] => Array (
                [
attribute] => Array (
                    [
1] => Array (
                        [@
attributes] => Array (
                            [
options_values_id] => 1-1
                        
)
                        [
products_options_id] => 1
                        
[products_options_values_id] => 1
                        
[options_values_price] => 0.0000
                        
[price_prefix] => +
                        [
options_name] => Array (
                            [
dutch] => Array (
                                [
products_options_name] => Kleur
                            
)
                        )

                        [
options_values_name] => Array (                               
                            [
dutch] => Array (
                                [
products_options_values_name] => Aluminium/Grijs
                            
)
                        )
                    )
                )
            )
            [
attributes_stock] => Array (
                [
attribute_stock] => Array (
                    [
8] => Array (
                        [@
attributes] => Array (
                            [
products_stock_id] => 8
                        
)                   
                        [
products_stock_attributes] => 1-1
                        
[products_stock_quantity] => 1
                        
[products_stock_article_nr] => 12345_ART_ALU
                        
[products_stock_ean] => 12345_EAN_ALU
                        
[products_stock_sku] => 12345_SKU_ALU
                    
)
                )
            )
            [
filters] => Array (
                [
filter] => Array (
                    [
5] => Array (
                        [@
attributes] => Array (
                            [
filter_id] => 5
                        
)
                        [
parent_id] => 3
                        
[sort_order] => 2
                        
[filter_name] => Array (
                            [
dutch] => Array (
                                [
filter_name] => Geel
                            
)
                        )
                    )
                    [
4] => Array (
                        [@
attributes] => Array (
                            [
filter_id] => 4
                        
)
                        [
parent_id] => 3
                        
[sort_order] => 4
                        
[filter_name] => Array (
                            [
dutch] => Array (
                                [
filter_name] => Rood
                            
)
                        )
                    )
                )
            )
            [
deliveries] => Array (
                [
delivery] => Array (
                    [@
attributes] => Array (
                        [
product_delivery_id] => 1
                    
)
                    [
delivery_name] => Array (
                        [
dutch] => Array (
                            [
delivery_name] => 9:00 nl
                        
)
                    )
                )
            )
            [
alternative_products] => Array (
                [
0] => Array (
                    [
product_id] => 25
                
)
            )
            [
required_products] => Array (
                [
0] => Array (
                    [
product_id] => 21
                
)
            )
        )
    )
)
?>