ebonit / centiro
PHP client for the Centiro SOAP webservice
1.0.7
2024-06-13 17:12 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-12-13 18:44:09 UTC
README
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));