The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::PaccoFacile - Perl library with MINIMAL interface to use PaccoFacile API.

SYNOPSIS

    use Net::PaccoFacile;
    use Data::Dump qw/dump/;

    my $pf = Net::PaccoFacile->new(
        mode            => 'live',
        token           => 'xxxx',
        api_key         => 'yyy',
        account_number  => '01234',
    );

    my $res;

    $res = $pf->request('carriers', 'get');
    say dump($res);

    $res = $pf->request('address-book', 'get');
    say dump($res);

    $res = $pf->request('shipment/quote', 'post', { 
        "shipment_service" => {
            "parcels" => [{
                "shipment_type" => 1,
                "dim1" => 10,
                "dim2" => 11,
                "dim3" => 12,
                "weight" => 2
            }],
            "accessories" => [],
            "package_content_type" => "GOODS"
        },
        "pickup" => {
            "iso_code" => "IT",
            "postal_code" => "04011",
            "city" => "Aprilia",
            "StateOrProvinceCode" => "LT"
        },
        "destination" => {
            "iso_code" => "IT",
            "postal_code" => "00135",
            "city" => "Roma",
            "StateOrProvinceCode" => "RM"
        },
    });

    say dump($res);

DESCRIPTION

This is HIGHLY EXPERIMENTAL and in the works, do not use for now.

AUTHOR

Michele Beltrame, mb@blendgroup.it

LICENSE

This library is free software under the Artistic License 2.0.