version 3.05


  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::Purolator - Interface to Purolator Shipping Web Services


This class provides an interface to the Purolator E-Ship Web Services.

For code examples, see

You must sign up for a development key in order to make use of this module.

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::UPS::WSDL interface was created primarily using the script from SOAP::WSDL.

Class Attributes

key, password

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 * (development) * (production)

Shipment::Base type maps

Shipment::Base provides abstract types which need to be mapped to Purolator codes (i.e. package_type of "custom" maps to Purolator "CustomerPackaging")

printer types

Purolator does not offer true thermal printing, all labels are provided as pdfs, thermal labels are simply a 4x6 pdf.

default currency

The default currency is CAD

Class Methods


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


will actually save a pdf file with all of the labels and documents. It is probably a better idea to make use of



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>


Issues can be submitted at


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 <>


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.