Shoptrader API docs
Orders
Het uitlezen, toevoegen, verwijderen en aanpassen van orders
Requests
Type | Call | Omschrijving |
---|---|---|
GET | /api/v2/orders/{orderId} |
Leest een specifieke order uit |
POST | /api/v2/orders |
Voegt een order toe |
DELETE | /api/v2/orders/{orderId} |
Verwijdert een order |
PHP Examples
Endpoint
GET /api/v2/orders/{orderId}
<?php
$strApiBaseUrl = 'uwdomein.uwdomeinextentie'; // base URL
$orderId = '50'; // order id - E.g. '50'
$token = '8f00f89310945a0ca35666c8c9ced2e314e37aa6c32e900932e19902b42208767'; // your API token
$strUrl = 'http://'.$strApiBaseUrl.'/api/v2/orders/'.$orderId.'?token='.$token;
$objCurl = curl_init();
curl_setopt($objCurl, CURLOPT_URL, $strUrl);
curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($objCurl, CURLOPT_TIMEOUT, 60);
curl_setopt($objCurl, CURLOPT_USERAGENT, 'Shoptrader');
// execute cURL
$responseCurl = curl_exec($objCurl);
if ($responseCurl === FALSE) {
echo "cURL Error: ".curl_error($objCurl);
} else {
print_r($responseCurl); // the successful response contains a JSON as shown below
}
?>
Show response
Endpoint
POST /api/v2/orders
basketKey string |
basketKey of a basket with products |
currencyType string |
For example USD for dollar. If empty then there is settled in euros |
languageId integer |
Language in which is settled. The following languages are supported: 4 (Dutch), 5 (English), 6 (German), 7 (French), 8 (Spanish), 9 (Italian). If empty, then payment is done in the standard language used in the store |
<?php
$strApiBaseUrl = 'uwdomein.uwdomeinextentie'; // base URL
$token = '8f00f89310945a0ca35666c8c9ced2e314e37aa6c32e900932e19902b42208767'; // your API token
$strUrl = 'http://'.$strApiBaseUrl.'/api/v2/orders?token='.$token;
$parameters = array(
"basketKey" => "{51271f4e-4acb-4583-a357-ac136f622f1d}",
"currencyType" => "EUR",
"languageId" => "4"
);
$objCurl = curl_init();
curl_setopt($objCurl, CURLOPT_URL, $strUrl);
curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($objCurl, CURLOPT_TIMEOUT, 60);
curl_setopt($objCurl, CURLOPT_USERAGENT, 'Shoptrader');
curl_setopt($objCurl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($objCurl, CURLOPT_POSTFIELDS, json_encode($parameters));
curl_setopt($objCurl, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
// execute cURL
$responseCurl = curl_exec($objCurl);
if ($responseCurl === FALSE) {
echo "cURL Error: ".curl_error($objCurl);
} else {
print_r($responseCurl); // the successful response contains a JSON as shown below
}
?>
Show response