PHP code example of buuum / puntopack

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

    

buuum / puntopack example snippets


$puntopack = new PuntoPack($engine, $key);

$tracking = $puntopack->getTracking('31187802');

object(stdClass)#284 (2) {
  ["code"]=>
  string(2) "24"
  ["response"]=>
  object(stdClass)#285 (5) {
    ["STAT"]=>
    string(2) "24"
    ["Libelle01"]=>
    string(0) ""
    ["Relais_Libelle"]=>
    string(0) ""
    ["Relais_Num"]=>
    string(0) ""
    ["Libelle02"]=>
    string(0) ""
  }
}

$info = new StickerInfo('CCC', 'LCC', 1000, 1, 0);
$addresse = new StickerAddresse('Nombre', 'direccion sender', 'City1', '08390', '+34600606060');
$addresse2 = new StickerAddresse('Nombre 2', 'direccion 2 ', 'City2', '08920', '+34600606064');

$sticky = $puntopack->createSticker($info, $addresse, $addresse2);

object(stdClass)#253 (2) {
  ["code"]=>
  string(1) "0"
  ["response"]=>
  object(stdClass)#254 (3) {
    ["STAT"]=>
    string(1) "0"
    ["ExpeditionNum"]=>
    string(8) "31432234"
    ["URL_Etiquette"]=>
    string(115) "/ww2/PDF/StickerMaker2.aspx?ens=ST1471&expedition=3044&lg=ES&format=A4&crc=FE5859A"
  }
}


$stickers = $this->puntopack->getStickers([31187798, 31187800, 31187801]);

object(stdClass)#257 (2) {
  ["code"]=>
  string(1) "0"
  ["response"]=>
  object(stdClass)#283 (3) {
    ["STAT"]=>
    string(1) "0"
    ["URL_PDF_A4"]=>
    string(133) "/ww2/PDF/StickerMaker2.aspx?ens=TDESDD1421&expedition=31187798;31187800;31187801&lg=ES&format=A4&crc=53EE42FFC459ABDE2778"
    ["URL_PDF_A5"]=>
    string(133) "/ww2/PDF/StickerMaker2.aspx?ens=TDESDD1421&expedition=31187798;31187800;31187801&lg=ES&format=A5&crc=53EE42FFC459ABDE2778"
  }
}