Tarun Baraiya
Tarun Baraiya

Reputation: 504

how to get Rate of FedEx Shipping using php

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

Answers (2)

Maksat
Maksat

Reputation: 361

Firstly you need to get a valid FedEx API key.

  1. Log into the FedEx developer center: http://www.fedex.com/us/developer/web-services/index.html
  2. Download and read the documentation
  3. Develop and Test
  4. Certification.
  5. Move to production.

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.

  1. https://github.com/rubaiet/fedex or
  2. https://github.com/JeremyDunn/php-fedex-api-wrapper

Upvotes: 1

yoshi
yoshi

Reputation: 113

you need to get a valid account, meter number first.

Upvotes: 2

Related Questions