Reputation: 504
i want to get rate from get Rate of FedEx Shipping using php, but how ?
i get some code from http://www.varnagiris.net/2006/06/01/php-fedex-shipping-rates-calculator/
and code is
$fedex = new Fedex;
$fedex->setServer("https://gatewaybeta.fedex.com/GatewayDC");
$fedex->setAccountNumber(123123123);
$fedex->setMeterNumber(12312312);
$fedex->setCarrierCode("FDXE");
$fedex->setDropoffType("REGULARPICKUP");
$fedex->setService($service, $serviceName);
$fedex->setPackaging("YOURPACKAGING");
$fedex->setWeightUnits("LBS");
$fedex->setWeight(17);
$fedex->setOriginStateOrProvinceCode("OH");
$fedex->setOriginPostalCode(44333);
$fedex->setOriginCountryCode("US");
$fedex->setDestStateOrProvinceCode("CA");
$fedex->setDestPostalCode(90210);
$fedex->setDestCountryCode("US");
$fedex->setPayorType("SENDER");
$price = $fedex->getPrice();
but i don't know how to use it ? can you help me please.
Upvotes: 2
Views: 3932
Reputation: 361
Firstly you need to get a valid FedEx API key.
In order to receive approval for rate services, tracking and FedEx locator just go to step 5. Move to production and fill all the information that appears when you press the "Get Production Key" button.
FedEx will send you an email with your key, meter number, and password.
You can use some ready examples for getting rates. It will be easier for you.
Upvotes: 1