Business::FedEx::RateRequest

Perl extension for getting available rates from FedEx using their Web Services API
Download

Business::FedEx::RateRequest Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steve Troxel
  • Publisher web site:
  • http://search.cpan.org/~troxel/

Business::FedEx::RateRequest Tags


Business::FedEx::RateRequest Description

Business::FedEx::RateRequest uses a simple XML/POST instead of the slower and more complex Soap based method to obtain available rates between two zip codes for a given package weight and size. At the time of this writing FedEx evidently encourages the use of Soap to get available rates and provides source code examples for Java, PHP, C# but no Perl. FedEx doesn't provide non-Soap XML examples that I could find. Took me a while to develop the XML request but it returns results faster than the PHP Soap method.The XML returned is voluminous, over 30k bytes to return a few rates, but is smaller than the comparable Soap results.SYNOPSIS use Business::FedEx::RateRequest; use Data::Dumper; # Get your account/meter/key/password numbers from Fedex my %rate_args; $rate_args{'account'} = '_your_account_number_'; $rate_args{'meter'} = '_your_meter_number_'; $rate_args{'key'} = '_your_key_'; $rate_args{'password'} = '_your_password_'; $rate_args{'uri'} = 'https://gatewaybeta.fedex.com:443/xml/rate'; my $Rate = new Business::FedEx::RateRequest(%rate_args); my %ship_args; $ship_args{'src_zip'} = '83835'; $ship_args{'dst_zip'} = '55411'; $ship_args{'weight'} = 5; # Optional args $ship_args{'dst_residential'} = 'true'; # defualt is commercial $ship_args{'insured_value'} = 50; my $rtn = $Rate->get_rates(%ship_args); if ( $rtn ) { print Dumper $rtn } else { print $Rate->err_msg() } Should return something like $VAR1 = ;Product's homepage


Business::FedEx::RateRequest Related Software