NAME

Shipment::Sendle

VERSION

version 3.11

SYNOPSIS

use Shipment::Sendle;
use Shipment::Address;
use Shipment::Package;

my $shipment = Shipment::Sendle->new(
  from_address => Shipment::Address->new( ... ),
  to_address => Shipment::Address->new( ... ),
  packages => [ Shipment::Package->new( ... ), ],
);

foreach my $service ( $shipment->all_services ) {
  print $service->id . " (" . $service->cost . ")\n";
}

$shipment->rate( 'ground' );
print $shipment->service->cost . "\n";

$shipment->ship( 'ground' );
$shipment->get_package(0)->label->save;

NAME

Shipment::Sendle - Interface to Sendle shipping API

ABOUT

This class provides an interface to the Sendle shipping API. You must sign up for an API key in order to make use of this module.

https://sandbox.sendle.com/users/sign_up

It is an extension of L<Shipment::Base>.

Class Attributes

user, api_key

Credentials required to access Sendle API

mode

This determines whether you will use the sandbox or live environment * sandbox.sendle.com (sandbox) * api.sendle.com (live)

api

The Shipment::Sendle::API object

_build_services

This calls the quoting API and always returns a single service for the current plan assigned to the account

This method ignores what is in $self->packages and uses a single package weighing 1 pound. The idea is to validate the from/to address and compare rates across service providers, but for accurate rating, and for multiple packages, the rate method should be used.

rate

This calls the quoting API and defaults to ground service which always points at the current plan set up for the account

If there is more than 1 package, multiple quotes are fetched

ship

This calls the create orders API and defaults to ground service which always points at the current plan set up for the account

If there is more than 1 package, separate orders are created for each package

track

This method calls the track_order endpoint of the API and returns the current state

AUTHOR

Andrew Baerg @ <andrew at pullingshots dot ca>

http://pullingshots.ca/

BUGS

Please contact me directly.

COPYRIGHT

Copyright (C) 2021 Andrew J Baerg, All Rights Reserved

NO WARRANTY

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.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Andrew Baerg <baergaj@cpan.org>

COPYRIGHT AND LICENSE

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.