Download the PHP package smart-dato/mondial-relay-shipping-sdk without Composer
On this page you can find all versions of the php package smart-dato/mondial-relay-shipping-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smart-dato/mondial-relay-shipping-sdk
More information about smart-dato/mondial-relay-shipping-sdk
Files in smart-dato/mondial-relay-shipping-sdk
Package mondial-relay-shipping-sdk
Short Description Laravel SDK for the Mondial Relay Dual Carrier API V2 (shipments & labels)
License MIT
Homepage https://github.com/smart-dato/mondial-relay-shipping-sdk
Informations about the package mondial-relay-shipping-sdk
Mondial Relay Dual Carrier API V2 SDK for Laravel
Create Mondial Relay / InPost shipments and print labels from Laravel using the Dual Carrier API V2. Labels can be retrieved as a PDF URL, raw ZPL/IPL printer code, or QR code.
Installation
Optionally publish the config file:
Set your credentials in .env:
While MONDIAL_RELAY_SHIPPING_SANDBOX is true, requests go to connect-api-sandbox.mondialrelay.com.
Usage
Delivery and collection modes
| Enum case | Code | Meaning |
|---|---|---|
DeliveryMode::PointRelais |
24R | Point Relais® delivery (requires deliveryLocation) |
DeliveryMode::PointRelaisXL |
24L | Point Relais® XL delivery (multi-parcel capable) |
DeliveryMode::HomeDelivery |
HOM | Home delivery (requires recipient phone) |
DeliveryMode::HomeDeliveryNextDay |
XOH | D+1 home delivery (requires EDI setup) |
DeliveryMode::MerchantDelivery |
LCC | Delivery back to the merchant (returns) |
CollectionMode::MerchantCollection |
CCC | Collected at the merchant (outbound) |
CollectionMode::PointRelaisCollection |
REL | Dropped off at a Point Relais® (returns) |
CollectionMode::PointRelaisReturn |
24R | Consumer return dropped off at a Point Relais®, combine with DeliveryMode::MerchantDelivery (LCC) |
Label output
Batches
createShipments() accepts multiple shipments and never throws for individual failures:
Multiple accounts
The facade uses the credentials from the config file. To ship on behalf of other accounts, instantiate clients directly — every setting is a constructor argument:
Raw request & response
Every live call carries the raw HTTP exchange — on results and on all exceptions thrown after the request was built:
On a connection failure response and status are null but the request XML is still available. The exchange is excluded from toArray()/toJson() so serialized results never leak credentials.
Error handling
All exceptions extend SmartDato\MondialRelayShipping\Exceptions\MondialRelayShippingException:
InvalidShipmentException— the shipment breaks a documented constraint before any HTTP call (missing relay location, parcel under 10 g, multi-parcel on a single-parcel mode, …)InvalidConfigurationException— missing/malformed credentials, customer id, or culture; thrown on the first API call, not when the client is resolved, so tooling that instantiates all container bindings (ide-helper:generate,artisan about) works without credentialsRequestFailedException— connection failure or non-2xx HTTP responseInvalidResponseException— the API returned unparseable XMLCriticalErrorException— the API rejected the whole request (e.g. authentication); inspect$exception->statusesShipmentFailedException—createShipment()could not create the shipment; inspect$exception->statuses
API warnings never throw — read them via $created->warnings() or $result->warnings().
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- SmartDato
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of mondial-relay-shipping-sdk with dependencies
ext-dom Version *
ext-simplexml Version *
illuminate/contracts Version ^12.0||^13.0
spatie/laravel-data Version ^4.23
spatie/laravel-package-tools Version ^1.16