PHP code example of schiggi / gls-cee-shipping-api
1. Go to this page and download the library: Download schiggi/gls-cee-shipping-api 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/ */
// Array of parcel numbers from GLS. Client / order ids optional. Can also be a numeric array.
$parcel_numbers = array(
'14050' => 00201084696
);
// Returns array with success message and pdf stream
$printed_parcels = $api->getParcelLabels($prepared_parcels);
var_dump($printed_parcels);
Array
(
[status] => 'success'
[error_description] => 'Error Description. Empty, if success'
[pdf] => is streamed labels. Use echo and correct pdf header to display
)
// Array of parcel numbers from GLS. Order references are optional. Can be numerical array.
$delete_parcels = Array
(
'14050' => '00209053638',
'14051' => '00209053637'
);
// Returns array with success message or error description
$deleted_parcels = $api->deleteParcels($delete_parcels);