Download the PHP package very-code-com/dpd-de-php without Composer

On this page you can find all versions of the php package very-code-com/dpd-de-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dpd-de-php

dpd-de-php

PHP client library for the DPD Cloud Service Webservice (DPD Deutschland).

An open-source PHP client for DPD Germany's Cloud Service: create shipments and download their labels, pre-flight validate orders server-side, track parcels via two different tracking models, find pickup ParcelShops, and fetch account pickup rules. SOAP by default, with an optional REST transport.

Latest Version Total Downloads CI Integration PHPStan PHP


Requirements


Installation


Quick Start

See examples/ for complete, runnable scripts.


Configuration

DPD Cloud Service uses two credential pairs, both issued by DPD:

Env variable Required Default Description
DPD_CLOUD_PARTNER_NAME yes - PartnerCredentials.Name
DPD_CLOUD_PARTNER_TOKEN yes - PartnerCredentials.Token
DPD_CLOUD_USER_ID yes - UserCredentials.cloudUserID (integer)
DPD_CLOUD_USER_TOKEN yes - UserCredentials.Token
DPD_CLOUD_ENV no production sandbox or production
DPD_CLOUD_LANGUAGE no de_DE Response language, e.g. de_DE, en_US
DPD_CLOUD_TIMEOUT no 30 Request timeout (seconds)
DPD_CLOUD_CONNECT_TIMEOUT no 10 Connection timeout (seconds)
DPD_CLOUD_DEBUG no 0 1/true to enable verbose debug output (see below)

Sandbox vs. production endpoints:

Environment SOAP endpoint REST base
Sandbox (Testsystem) https://cloud-stage.dpd.com/services/v1/DPDCloudService.asmx https://cloud-stage.dpd.com/api/v1
Production https://cloud.dpd.com/services/v1/DPDCloudService.asmx https://cloud.dpd.com/api/v1

DPD issues separate credentials per environment: your production PartnerCredentials/UserCredentials will not work against the sandbox and vice versa. Using live credentials against cloud-stage returns ErrorID 2000 / CLOUD_API_PARTNERCREDENTIALS, and vice versa.

Where to get sandbox (Testsystem) credentials

Register a free developer account at esolutions.dpd.com/entwickler/registrieren.aspx, then log in.

Do not use the portal's "Benutzerdaten ändern" / "Sandbox Zugangsdaten" page. Despite what the official PDF (page 2) and DPD support both tell you, that page shows credentials for a different API: DPD Web Connect (public-ws-stage.dpd.com, DelisID + password and a getAuth call returning an authToken, i.e. sandboxdpd / xMm...). Those do not work with the Cloud Service and are not convertible into Cloud credentials: the formats are incompatible (PartnerCredentials.Token is 10-25 chars, cloudUserID is an integer).

The DPD Cloud sandbox credentials are pre-filled inside the portal's code examples:

Entwickler / DPD Cloud Webservice / Code Beispiele / SOAP (or REST) / Microsoft .NET, Java or PHP

https://esolutions.dpd.com/entwickler/dpdcloudwebservice/code-beispiele-soap-microsoft.aspx?allowcloud=true

Note the ?allowcloud=true query parameter: the entire Cloud section of the portal is unreachable through the normal logged-in navigation without it.

The snippets contain a shared, generic sandbox account: the same values for every developer, not personalised to you. Copy the four values out of the snippet into your environment (only their leading characters are shown here):

That account covers all five operations over both SOAP and REST, including setOrder with startOrder, which returns a real PDF label. Its own pickup address resolves to ZIP 63110, depot 0163.

For production credentials, contact DPD via the eSolutions portal or [email protected]; they are issued by e-mail in exactly the same four-value shape.

Debug mode

Set the debug flag (constructor arg, DPD_CLOUD_DEBUG=1, or 'debug' => true in fromArray) to make the client attach the raw DPD response to every thrown exception and log a full debug report (message + raw XML/JSON + stack trace) at error level via the injected PSR-3 logger:

Leave debug off in production to keep exceptions and logs concise.


Documentation

Document Contents
docs/API.md Every client method, the DTOs they take and return, the local validation rules, and the exception hierarchy
docs/DPD-NOTES.md DPD's own quirks: the two tracking models, SOAP/REST transport details, fields that are mandatory despite being optional in the WSDL
examples/ Runnable scripts covering shipments, batching, tracking, ParcelShops, REST, business rules and error handling

Dependency Injection & Testing

The client accepts a custom TransportInterface and PSR-3 logger:

Implement TransportInterface::send(TransportRequest): TransportResponse to swap in a PSR-18 HTTP client adapter, or a scripted fake for tests, see tests/Unit/DpdCloudClientTest.php for the pattern used by this library's own test suite (no real network calls).


Running Tests

The integration suite exercises all five operations over both transports against cloud-stage.dpd.com, including a real setOrder/startOrder that issues a label. Add DPD_CLOUD_ALLOW_LABELS=0 to skip the two label-issuing tests and keep the run read-only.

Continuous integration

Workflow Runs What it does
ci.yml every push and pull request Unit tests on PHP 8.2/8.3/8.4, PHPStan level 8, composer validate, lints every example
integration.yml pushes to master, nightly, manual The sandbox integration suite

The integration workflow is deliberately kept out of the pull-request gate: forks cannot read repository secrets, and DPD enforces a per-account call limit (2027 CLOUD_API_USERCALLLIMIT, 10-minute cool-down) that a per-push, per-PHP-version run would walk straight into. It is serialised through a concurrency group for the same reason.

To enable it, add the four sandbox values (DPD_CLOUD_PARTNER_NAME, DPD_CLOUD_PARTNER_TOKEN, DPD_CLOUD_USER_ID, DPD_CLOUD_USER_TOKEN) to a repository environment named dpd-sandbox, restricted to the master branch. Environment secrets are only readable by jobs that opt into that environment, so a workflow added on a side branch cannot reach them. Without them the job reports "not configured" and stops rather than failing the build. Running it manually (workflow_dispatch) offers a checkbox to skip the label-issuing tests.


License

NOTICE for attribution requirements.

You may use, distribute, and modify this library freely. You must retain the NOTICE file and copyright notices in any redistribution or derivative work.


Built by Very Code. Contributions welcome, open an issue or PR.


All versions of dpd-de-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-curl Version *
ext-dom Version *
ext-json Version *
psr/log Version ^2.0|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package very-code-com/dpd-de-php contains the following files

Loading the files please wait ...