SPS Webship API PHP client implementation. See webservice documentation for details.
Install the latest version using composer require riesenia/sps-webship-api
Create API with username and password
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();
}