PHP code example of zookal / auspost-api-php

1. Go to this page and download the library: Download zookal/auspost-api-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zookal / auspost-api-php example snippets







Auspost\Common\Auspost;
use Auspost\Postage\Enum\ServiceCode;

// Instantiate a Postage Assessment Calculator service
$client = Auspost::factory('/path/to/config.php')->get('postage');

$result = $client->calculateDomesticParcelPostage(array(
    'from_postcode' => 3000,
    'to_postocde' => 3011,
    'length' => 10,
    'width' => 10,
    'height' => 10,
    'weight' => 10,
    'service_code' => ServiceCode::AUS_PARCEL_REGULAR
));
json
{
    "ontis/auspost-api-php": "*"
    }
}
bash
$ curl -sS https://getcomposer.org/installer | php
bash
$ php composer.phar install
bash
$ git clone https://github.com/fontis/auspost-api-php
bash
$ cd auspost-api-php
$ curl -sS https://getcomposer.org/installer | php
bash
$ php composer.phar install