PHPackages                             maxs94/internetmarke-rest-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. maxs94/internetmarke-rest-php

ActiveLibrary[API Development](/categories/api)

maxs94/internetmarke-rest-php
=============================

Deutsche Post INTERNETMARKE REST client for PHP

v1.0.4(4mo ago)23MITPHPPHP ^8.1

Since Jan 5Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/maxs94/internetmarke-rest-php)[ Packagist](https://packagist.org/packages/maxs94/internetmarke-rest-php)[ RSS](/packages/maxs94-internetmarke-rest-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

Internetmarke PHP Client
========================

[](#internetmarke-php-client)

PHP client for the Deutsche Post DHL Internetmarke API.
-------------------------------------------------------

[](#php-client-for-the-deutsche-post-dhl-internetmarke-api)

### Links

[](#links)

- [Internetmarke API Documentation (German)](https://www.dhl.de/de/geschaeftskunden/internetmarke/api.html)
- [DHL Developer Portal (German)](https://entwickler.dhl.de/)
- [Portokasse](https://portokasse.deutschepost.de/portokasse/)

### Documentation

[](#documentation)

- [AppResource](doc/AppResource.md)
- [ApiVersionResource](doc/ApiVersionResource.md)
- [UserResource](doc/UserResource.md)

### This repository provides:

[](#this-repository-provides)

- HTTP client and service-layer classes to call the Internetmarke API. See documentation: [AppResource](doc/AppResource.md), [ApiVersionResource](doc/ApiVersionResource.md), [UserResource](doc/UserResource.md).
- DTO models for request/response payloads.
- Token provider for OAuth-like authentication.
- PHPUnit tests.

### Highlights of recent changes

[](#highlights-of-recent-changes)

- Base URI for requests is centralized in `ClientConfig`
- `ApiClient` implements `ApiClientInterface`.
- `TokenProvider` implements `TokenProviderInterface`.
- `AuthenticationRequest` DTO introduced and used by `TokenProvider` and `UserResource`.
- Tests were updated to use `ClientConfig('')` to avoid automatic base URI prefixing during unit tests.
- Several classes and tests were adapted to be more testable and type-safe.
- added Makefile for common tasks (install, test, etc.)
- added Internetmarke facade for easy setup and usage.

### Requirements

[](#requirements)

- PHP 8.1+ (or the project's required PHP version)
- Composer
- client (provided via composer)
- PHPUnit (dev dependency)

### Installation

[](#installation)

Use the included Make targets to install dependencies:

```
# install PHP dependencies
make install
```

(If you prefer running composer directly, `composer install` is equivalent.)

### Usage

[](#usage)

The simplest way to get started is to use the `Internetmarke` facade class, which handles configuration, token provision, and API client setup for you:

```
use Maxs94\Internetmarke\Internetmarke;

$internetmarke = new Internetmarke(
    'your-client-id',
    'your-client-secret',
    'your-username',
    'your-password'
);

// get API version information
var_dump($internetmarke->getApiVersionResource()->getVersion());

// walletBalance can be retrieved from the tokenProvider,
// as DHL includes it in the authentication response
var_dump($internetmarke->getTokenProvider()->getAuthentication()->getWalletBalance());

// get user profile
var_dump($internetmarke->getUserResource()->getUserProfile());
```

### Creating a label

[](#creating-a-label)

To create and checkout a label, see the [AppResource documentation](doc/AppResource.md) for details and code examples.

### Testing

[](#testing)

Run the test suite with the Make targets:

```
# or explicitly run phpunit
make phpunit

# run static analysis
make phpstan

# fix coding standards issues
make csfix
```

### Development notes

[](#development-notes)

- Prefer `ClientConfig` for all places where a base URI must be configured — it centralizes the setting.
- The `ApiClientInterface` and `TokenProviderInterface` allow you to provide your own implementations for special cases (e.g. custom HTTP adapters, testing).
- If you need to mock the token provider or API client in tests, mock the interface types (`TokenProviderInterface` and `ApiClientInterface`) instead of final concrete classes.

### Contributing

[](#contributing)

- Fork the repo, create a branch, add tests for any new behavior and open a pull request.
- Keep backward-compatibility in mind; update the README and tests when making breaking changes.
- Run `make phpunit`, `make csfix` and `make phpstan` before submitting a PR - they should pass without errors.

### License

[](#license)

- Please see the LICENSE file in the repository.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance77

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

5

Last Release

125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a638d6d04f2fe0c0a4d4ade0cfd65824128010f395a841ce46515fab0fc749b4?d=identicon)[maxs94](/maintainers/maxs94)

---

Top Contributors

[![maxs94](https://avatars.githubusercontent.com/u/12135695?v=4)](https://github.com/maxs94 "maxs94 (30 commits)")

---

Tags

api-restdeutsche-postdhl-apiinternetmarkephpportokassestamp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maxs94-internetmarke-rest-php/health.svg)

```
[![Health](https://phpackages.com/badges/maxs94-internetmarke-rest-php/health.svg)](https://phpackages.com/packages/maxs94-internetmarke-rest-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
