PHP code example of trixpua / shipping

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

    

trixpua / shipping example snippets



Trixpua\Shipping\Tnt\Quote\Tnt;
use Trixpua\Shipping\ShippingInfo;

$tnt = new Tnt('YOUR-ZIP-CODE', '[email protected]', 'yourPassword', 'YOUR-DIVISION-CODE', 'YOUR-TAX-SITUATION', 'YOUR-TAX-ID', 'YOUR-STATE-REGISTRATION-NUMBER');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$tnt->setData($shippingInfo);

$tnt->makeRequest();

$return = $tnt->getResult();


Trixpua\Shipping\Jamef\Quote\Jamef;
use Trixpua\Shipping\ShippingInfo;

$jamef = new Jamef('yourUser', 'YOUR-TAX-ID', 'YOUR STATE', 'YOUR CITY NAME', 'YOUR-QUOTE-BRANCH');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$jamef->setData($shippingInfo);

$jamef->makeRequest();

$return = $jamef->getResult();


Trixpua\Shipping\Correios\Quote\Correios;
use Trixpua\Shipping\ShippingInfo;

$correios = new Correios('YOUR-ZIP-CODE', 'YOUR-LOGIN', 'yourPassword');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$correios->setData($shippingInfo);

$correios->makeRequest();

$return = $correios->getResult();


Trixpua\Shipping\ShippingInfo;
use Trixpua\Shipping\TamCargo\Quote\TamCargo;

$tam = new TamCargo('YOUR-ZIP-CODE', '[email protected]', 'yourPassword');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$tam->setData($shippingInfo);

$tam->makeRequest();

$return = $tam->getResult();


Trixpua\Shipping\ExpressoSaoMiguel\Quote\ExpressoSaoMiguel;
use Trixpua\Shipping\ShippingInfo;

$expressoSaoMiguel = new ExpressoSaoMiguel('YOUR-ZIP-CODE','yourUser', 'yourPassword');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$expressoSaoMiguel->setData($shippingInfo);

$expressoSaoMiguel->makeRequest();

$return = $expressoSaoMiguel->getResult();


Trixpua\Shipping\Tnt\Tracking\Tnt;

$tnt = new Tnt('[email protected]', 'YOUR-TAX-ID');

$tnt->setData('INVOICE-NUMBER');

$tnt->makeRequest();

$return = $tnt->getResult();


Trixpua\Shipping\Jamef\Tracking\Jamef;

$jamef = new Jamef('yourUsername', 'yourPassword', '00.000.000.0000-00');

$jamef->setData('INVOICE-NUMBER');

$jamef->makeRequest();

$return = $jamef->getResult();



use Trixpua\Shipping\Correios\Tracking\Correios;

$correios = new Correios();

$correios->setData(['TRACKING-NUMBERS']);

$correios->makeRequest();

$return = $correios->getResult();