PHP code example of riesenia / sps-webship-api

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

    

riesenia / sps-webship-api example snippets


use Riesenia\SpsWebship\Api;

$api = new Api($username, $password);

$data = [
    'cod' => [
        'codvalue' => 12.30
    ],
    'insurvalue' => 12.30,
    'notifytype' => 1,
    ...
];

if (!$api->createShipment($shipment)) {
    echo $api->getMessages();
}

$url = $api->printShipmentLabels();

if (!$url) {
    echo $api->getMessages();
}

$url = $api->printEndOfDay();

if (!$url) {
    echo $api->getMessages();
}