Shipment::Purolator
version 0.18
use Shipment::Purolator; use Shipment::Address; use Shipment::Package; my $shipment = Shipment::Purolator->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::Purolator - Interface to Purolator Shipping Web Services
This class provides an interface to the Purolator E-Ship Web Services. You must sign up for a development key in order to make use of this module.
https://eship.purolator.com
It is an extension of Shipment::Base.
It makes extensive use of SOAP::WSDL in order to create/decode xml requests and responses. The Shipment::UPS::WSDL interface was created primarily using the wsdl2perl.pl script from SOAP::WSDL.
Credentials required to access Puroator E-Ship Web Services
This determines whether you will use the Purolator testing environment (for development) or the production (live) environment * devwebservices.purolator.com (development) * webservices.purolator.com (production)
Shipment::Base provides abstract types which need to be mapped to Purolator codes (i.e. package_type of "custom" maps to Purolator "CustomerPackaging")
Purolator does not offer true thermal printing, all labels are provided as pdfs, thermal labels are simply a 4x6 pdf.
The default currency is CAD
This calls GetServicesOptions from the Service Availability API
Each Service that is returned is added to services
The following service mapping is used: * ground => PurolatorGround (when shipping within the same city this gets mapped to PurolatorExpress) * express => PurolatorExpress * priority => PurolatorExpress9AM/10:30AM/12:00/Evening (exact service depends on what is available)
All of the available service options are placed in the service->options hashref
This method calls GetFullEstimate from the Estimating API
This calls CreateShipment from the Shipping API
It also calls fetch_documents which is a separate method since Purolator does not return the label along with the create shipment response.
Calls GetDocuments from the Shipping Documents API
Purolator returns all of the labels and required documents in a single pdf. Because of this, for a multi-piece shipment, calling
$shipment->get_package(0)->label-save;
will actually save a pdf file with all of the labels and documents. It is probably a better idea to make use of
$shipment->documents->save
Calls VoidShipment from the Shipping API
For multi-piece shipments, any 1 of the related tracking id's can be in $shipment->tracking_id. All related packages will be voided. There is no way to void a single package within a multi-piece shipment.
returns "true" if successful
This depends on calling Consolidate from the Shipping API which has not been implemented yet
Calls GetShipmentManifestDocument from the Shipping Documents API
Andrew Baerg @ <andrew at pullingshots dot ca>
http://pullingshots.ca/
Please contact me directly.
Copyright (C) 2010 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) 2013 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.