ebonit/centiro

PHP client for the Centiro SOAP webservice

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

pkg:composer/ebonit/centiro

1.0.7 2024-06-13 17:12 UTC

This package is auto-updated.

Last update: 2025-12-13 18:44:09 UTC


README

Latest Stable Version Total Downloads License

Installation:

composer require ebonit/centiro

Basic Usage:

use \Ebonit\Centiro\Client;

$client = new Client($cntiro_username, $centiro_password);

Example to create a new shipment: shipment requirements can be found at

Ebonit\Centiro\Method\Shipment
$shipment['Addresses'] = [$this->createAddressData($arguments)]; 
$shipment['Attributes'] = $this->createAttributes($pd, $format);
$shipment['Parcels'] = [$this->createParcelData($arguments)];            
$shipment['OrderNumber'] = $shipmentIdentifier;
$shipment['SenderCode'] = $_ASENDIA_CUSTOMER_ID);
$shipment['ShipDate'] = date("Y-m-d", strtotime('+2 days')).'T'.date("H:i:s");
$shipment['ShipmentIdentifier'] = $shipmentIdentifier;
$shipment['Currency'] = 'EUR';

Example to create parcel and print the sticker: parcel, details can be found at

Ebonit\Centiro\Method\Parcel
$parcelDetails = [...aarray with required details...];
$response = $client->addAndPrintShipment($shipment);

To save the sticker data (zpl, pdf is also possible):

$printFile = base_path() . "/storage/centiro_zpl/" . $response->Shipments->SequenceNumber . ".zpl";
file_put_contents($printFile, base64_decode($response->ParcelDocuments->ParcelDocument->Content));