PHP code example of mannysoft / auspost-api-php

1. Go to this page and download the library: Download mannysoft/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/ */

    

mannysoft / 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_postcode' => 3011,
    'length' => 10,
    'width' => 10,
    'height' => 10,
    'weight' => 10,
    'service_code' => ServiceCode::AUS_PARCEL_REGULAR
));
json
    {
        "s/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