Shipment::FedEx
version 3.10
use Shipment::FedEx; use Shipment::Address; use Shipment::Package; my $shipment = Shipment::FedEx->new( from_address => Shipment::Address->new( ... ), to_address => Shipment::Address->new( ... ), packages => [ Shipment::Package->new( ... ), ], ); foreach my $service ( $shipment->all_services ) { print $service->id . "\n"; } $shipment->rate( 'express' ); print $shipment->service->cost . "\n"; $shipment->ship( 'ground' ); $shipment->get_package(0)->label->save;
Shipment::FedEx - Interface to FedEx Shipping Web Services
This class provides an interface to the FedEx Web Services for Shipping.
For code examples, see https://github.com/pullingshots/Shipment/tree/master/eg
You must sign up for a developer test key in order to make use of this module.
https://www.fedex.com/wpor/web/jsp/drclinks.jsp?links=techresources/index.html
See related modules for documentation on options and how to access rates and labels:
Shipment::Base - common attributes and methods for all interfaces
Shipment::Address - define an from or to address
Shipment::Package - define package details, weight, dimensions, etc
Shipment::Service - access information about a service, rate, etd, etc
Shipment::Label - access the label file
It makes extensive use of SOAP::WSDL in order to create/decode xml requests and responses. The Shipment::FedEx::WSDL interface was created primarily using the wsdl2perl.pl script from SOAP::WSDL.
Credentials required to access FedEx Web Services
This determines whether you will use the FedEx Web Services Testing Environment or the production (live) environment * wsbeta.fedex.com:443 (testing) * ws.fedex.com:443 (live)
special services offered by FedEx, for example SATURDAY_DELIVERY
Flag the ship to address as residential.
Default is false.
The label dimensions/type.
Default: 4x6
Shipment::Base provides abstract types which need to be mapped to FedEx codes (i.e. bill_type of "sender" maps to FedEx "SENDER")
FedEx offers collect billing (without the need for a billing account #)
FedEx provides package types in addition to the defaults in Shipment::Base * FEDEX_10KG_BOX * FEDEX_25KG_BOX
The default currency is USD
This calls getRates from the Rate Services API
Each Service that is returned is added to services
The following service mapping is used: * ground => FEDEX_GROUND or GROUND_HOME_DELIVERY or INTERNATIONAL_GROUND * express => FEDEX_2_DAY or INTERNATIONAL_ECONOMY * priority => PRIORITY_OVERNIGHT or INTERNATIONAL_PRIORITY
This method ignores what is in $self->packages and uses a single package weighing 1 pound for rating. The idea is to list what services are available, but for accurate rate comparisons, the rate method should be used.
This method calls processShipment from the Ship Services API
This method calls deleteShipment from the Ship Services API
If the tracking id is greater than 12 digits, it assumes that it is a Ground shipment.
Currently only supports deleting one package (tracking id) at a time - DeletionControl = 'DELETE_ONE_PACKAGE'
returns "SUCCESS" if successful
This method calls track from the Tracking Services API
Currently only supports tracking using a valid tracking number: Type => 'TRACKING_NUMBER_OR_DOORTAG'
Result is added to $self->activities, accessible using $self->status
Also sets $self->ship_date
This method calls groundClose from the Close Services API
The manifest is a plain text file intended to be printed off on standard letter paper
Andrew Baerg @ <andrew at pullingshots dot ca>
http://pullingshots.ca/
Issues can be submitted at https://github.com/pullingshots/Shipment/issues
Copyright (C) 2016 Andrew J Baerg, All Rights Reserved
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Andrew Baerg <baergaj@cpan.org>
This software is copyright (c) 2018 by Andrew Baerg.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Shipment, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Shipment
CPAN shell
perl -MCPAN -e shell install Shipment
For more information on module installation, please visit the detailed CPAN module installation guide.