myparcelnl/sdk
Official MyParcel NL PHP SDK for creating shipments, managing labels, tracking, and handling returns via the MyParcel API. Offers a clean, object-oriented interface for integrating Dutch parcel carriers into Laravel or plain PHP applications.
Architecture fit. The SDK is a framework-agnostic PHP client, which is a reasonable fit for Laravel but not a drop-in one. There is no service provider, config file, facade, or published contract, so the integration work is ours: binding a configured client into the container, externalizing credentials, and wrapping calls behind an application-owned interface. That is straightforward work, but it means the SDK should sit behind a thin adapter (e.g., ShippingProvider port) rather than being called directly from controllers, jobs, and checkout code. This preserves the ability to swap carriers or fall back to raw HTTP if the package stalls.
Integration feasibility. High for the core flows: create shipment, fetch label PDF, poll track & trace, list delivery options and pickup points. These map cleanly onto queued Laravel jobs and events. The main unknowns are around webhooks (does MyParcel push status updates, and is signature verification supported?), idempotency on shipment creation (critical — a timeout plus retry must not create duplicate labels that we pay for), and whether the SDK exposes the underlying API error codes with enough granularity to build a retryable/non-retryable taxonomy.
Technical risk.
NOASSERTION. This is a hard gate. We cannot ship a dependency into a commercial checkout path without legal confirming redistribution and modification rights. This alone can block adoption.Key questions.
Stack fit. Treat the SDK as an infrastructure detail inside a bounded Shipping module: a MyParcelClientFactory bound as a singleton, credentials from config/services.php and env, and a ShipmentService/LabelService that returns our own DTOs. Controllers and checkout components never touch SDK classes. Register the binding in a dedicated service provider so tests can substitute a fake.
Migration path. If we already generate labels manually or via raw HTTP, introduce the adapter interface first and reimplement the existing path behind it. Then add the SDK as a second implementation and run both in shadow mode for a limited cohort: create the shipment via the SDK but reconcile against the manual result before cutting over. Feature-flag by carrier and region so a MyParcel outage or defect degrades to the prior path rather than blocking fulfillment.
Compatibility. Pin an exact minor version and commit the lockfile. Verify PHP version, Guzzle major, and ext-* requirements against our runtime before the spike. If the SDK lags our Laravel/PHP upgrade cadence, plan to fork with a minimal patch branch rather than waiting upstream. Isolate the dependency so a future replacement only touches the adapter layer.
Sequencing.
Maintenance. Expect to own the integration, not just consume it. Budget for periodic dependency bumps, monitoring upstream API changes, and a realistic possibility of carrying a fork. Assign a named owner and track the package in our dependency-review process; a stale release or silent breaking change should surface as an alert, not an incident.
Support. Distinguish three support layers: MyParcel's API/carrier support, the package maintainer (likely best-effort), and our internal on-call. Contractual questions — SLA, incident contacts, label cost disputes — go to MyParcel, not the package. Document this escalation path before launch.
Scaling. Label generation is I/O and PDF-heavy; keep it off the request cycle and in queue workers with bounded concurrency. Respect API rate limits with a per-account limiter; cache pickup points and delivery options with short TTLs since they are read-heavy at checkout. Watch for per-account throughput ceilings during peak (e.g., holiday) and load-test the queue path, not just the happy-path API call.
Failure modes.
Ramp-up. There is real domain learning here: carrier product codes, delivery options, customs data for non-EU, and NL/BE-specific conventions, with documentation that may be partly Dutch-language. Plan a short ramp with a shipping-operations stakeholder, build a small sandbox harness for the team, and encode the carrier/option matrix in configuration rather than code so ops can adjust without a deploy. Start with one carrier and one region, prove the label and tracking loop end to end, then widen.
How can I help you explore Laravel packages today?