...
<?php $json = array("portal" => "DKWWFCOPEN", "username" => "MYUSERNAME", "password" => "MYPASSWORD", "apikey" => "", // empty for now "commands" => array(array("command" => "GetPriceCalculation", "from_country" => 23, "from_location" => 1, "to_country" => 23, "to_location" => 2, "pcs1" => 1, "packtype1" => 23, "weight1" => 100, "volume1" => 1,
"width1" => 50, // width/height/length is optional
"height1" => 50,
"lengthlength1" => 10, ) ) ); $d = file_get_contents("https://portal.ff.geodis.com/api/endpoint.php?json=".json_encode($json)); $d = json_decode($d, true); if ($d['status'] != 1) exit('failed: '.$d['msg']); $c = $d['results'][0]; if ($c['status'] != 1) exit('GetPriceCalculation failed: '.$c['msg']); $sheets = $c['sheets']; // the result for each price sheet foreach ($sheets as $sheet) { // the result for a price sheet includes title,currency,total cost,addon,transittime,note and lines // each line describes a fee or other cost echo "\n"; echo "Title: ".$sheet['title']."\n"; echo "Currency: ".$sheet['currency']."\n"; echo "Total cost: ".$sheet['total_excl']."\n"; } ?>