Shoptrader API docs

Image Description

Get - Product

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
product_id integer Ja Product ID van het artikel
language_id integer Nee Indien leeg toon alle talen
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

JSON example

<?php
ini_set
('max_execution_time'0);

// Set the Content-Type
header('Content-Type: application/json');

ini_set('max_execution_time'0);

$strApiBaseUrl 'uwdomeinnaam.uwdomeinextentie';
$strOutput 'json';
$strUrl 'http://' $strApiBaseUrl '/Api/Get/Product/?' $strOutput;

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

// Custom param
$arrParams['product_id']    = 1596;

$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);
// }

JSON Resultaat:

Alle prijzen zijn exclusief BTW

{
    "products": {
        "1596": {
            "@attributes": {
                "product_id": "1596"
            },
            "products_name": "Nike F.C.B. Short 2017/2018",
            "layover": "0",
            "onHomepage": "0",
            "isActive": "1",
            "isBundle": "0",
            "sort_order": "0",
            "sort_order_home": "0",
            "products_model": "252",
            "products_ean": "",
            "products_sku": "",
            "products_quantity": "50",
            "products_weight": "90.00",
            "products_price_ex": "49.5868",
            "purchase_price": "0.0000",
            "products_discounts": [],
            "offer_price": [
                {
                    "offer_price_ex": null,
                    "offer_price_expire_date": null,
                    "offer_price_status": null
                }
            ],
            "products_tax": 21,
            "products_tax_class_id": "3",
            "products_order_quantity": "0",
            "products_quote": "0",
            "dailyOffer": "0",
            "product_available_from": "0000-00-00 00:00:00",
            "product_available_to": "0000-00-00 00:00:00",
            "products_free_above": "",
            "manufacturers_id": "9",
            "manufacturers_name": "Adidas",
            "length": "0.0000",
            "width": "0.0000",
            "date_added": "-0001-11-30 00:00:00",
            "last_modified": "2018-01-19 15:38:17",
            "urls": {
                "dutch": {
                    "url": "/broeken/adidas-rm-uitshort"
                }
            },
            "products_name_languages": {
                "dutch": {
                    "name": "Nike F.C.B. Short 2017/2018"
                }
            },
            "description": {
                "dutch": {
                    "description": {
                        "@cdata": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam accumsan vulputate commodo. Nunc placerat consectetur mauris. Integer at interdum ligula. Donec at hendrerit velit. Nunc feugiat porta nunc non iaculis. Sed scelerisque nulla odio, sit amet vulputate libero feugiat at. Nulla ut consectetur turpis. Pellentesque diam neque, pellentesque et sapien sed, iaculis laoreet nisl. Integer malesuada sit amet lacus ut commodo. Proin bibendum nulla et nunc luctus, eget mattis nulla pulvinar. Nam luctus dapibus turpis vitae fermentum. In laoreet ultricies aliquet. Ut quis sem sit amet sem vehicula pellentesque. Suspendisse feugiat mi et erat mollis viverra.</p>\r\n"
                    },
                    "shortDescription": {
                        "@cdata": null
                    },
                    "extraInformation": {
                        "@cdata": ""
                    }
                }
            },
            "meta": {
                "dutch": {
                    "products_seo_url": "adidas-rm-uitshort",
                    "products_meta_title": "",
                    "products_meta_keywords": "",
                    "products_meta_description": ""
                }
            },
            "images": {
                "image1": "4-10-2017-10-29-32.jpg",
                "image1_url": "/images/productimages/big/4-10-2017-10-29-32.jpg",
                "image1_alt": "4-10-2017-10-29-32.jpg",
                "image2": "4-10-2017-10-31-34.jpg",
                "image2_url": "/images/productimages/big/4-10-2017-10-31-34.jpg",
                "image2_alt": "4-10-2017-10-31-34.jpg",
                "image3": "",
                "image3_url": "",
                "image3_alt": "",
                "image4": "",
                "image4_url": "",
                "image4_alt": "",
                "image5": "",
                "image5_url": "",
                "image5_alt": "",
                "image6": "",
                "image6_url": "",
                "image6_alt": "",
                "image7": "",
                "image7_url": "",
                "image7_alt": "",
                "image8": "",
                "image8_url": "",
                "image8_alt": "",
                "image9": "",
                "image9_url": "",
                "image9_alt": "",
                "image10": "",
                "image10_url": "",
                "image10_alt": "",
                "image11": "",
                "image11_url": "",
                "image11_alt": "",
                "image12": "",
                "image12_url": "",
                "image12_alt": ""
            },
            "marktplaats": {
                "products_admarkt": "0"
            },
            "advertentieplanet": {
                "products_advertentieplanet": "0"
            },
            "beslist": {
                "products_beslist": "0",
                "products_beslist_origineel": "1"
            },
            "google": {
                "products_google_shopping": "0",
                "products_google_shopping_gtin": "0",
                "products_google_shopping_identifier_exists": "0"
            },
            "kieskeurig": {
                "products_kieskeurig": "0"
            },
            "tweakers": {
                "products_tweakers": "0"
            },
            "kelkoo": {
                "products_kelkoo": "0"
            },
            "categories": {
                "category": {
                    "888911": {
                        "@attributes": {
                            "category_id": "888911"
                        },
                        "is_main_category": "1",
                        "tree": "888911",
                        "name": {
                            "dutch": {
                                "categories_name": "Broeken"
                            }
                        },
                        "seo_url": {
                            "dutch": {
                                "categories_seo_url": "broeken"
                            }
                        },
                        "path": {
                            "dutch": {
                                "categories_path": "Broeken"
                            }
                        }
                    }
                }
            },
            "features": [],
            "attributes": {
                "attribute": {
                    "112": {
                        "@attributes": {
                            "options_values_id": "2-10"
                        },
                        "products_options_id": "2",
                        "products_options_values_id": "10",
                        "options_values_price": "0.0000",
                        "price_prefix": "+",
                        "options_name": {
                            "dutch": {
                                "products_options_name": "Maten"
                            }
                        },
                        "options_values_name": {
                            "dutch": {
                                "products_options_values_name": "S"
                            }
                        }
                    },
                    "113": {
                        "@attributes": {
                            "options_values_id": "2-11"
                        },
                        "products_options_id": "2",
                        "products_options_values_id": "11",
                        "options_values_price": "0.0000",
                        "price_prefix": "+",
                        "options_name": {
                            "dutch": {
                                "products_options_name": "Maten"
                            }
                        },
                        "options_values_name": {
                            "dutch": {
                                "products_options_values_name": "M"
                            }
                        }
                    },
                    "114": {
                        "@attributes": {
                            "options_values_id": "2-12"
                        },
                        "products_options_id": "2",
                        "products_options_values_id": "12",
                        "options_values_price": "0.0000",
                        "price_prefix": "+",
                        "options_name": {
                            "dutch": {
                                "products_options_name": "Maten"
                            }
                        },
                        "options_values_name": {
                            "dutch": {
                                "products_options_values_name": "L"
                            }
                        }
                    }
                }
            },
            "attributes_stock": [],
            "filters": [],
            "deliveries": [],
            "alternative_products": false,
            "required_products": false
        }
    }
}