PHPackages                             deutschepost/sdk-api-internetmarke - 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. deutschepost/sdk-api-internetmarke

ActiveLibrary

deutschepost/sdk-api-internetmarke
==================================

Deutsche Post Internetmarke REST API SDK

1.0.0(2mo ago)0301—9.6%[1 PRs](https://github.com/netresearch/deutschepost-sdk-api-internetmarke/pulls)1MITPHPPHP ^8.3.0CI passing

Since Mar 11Pushed 1mo agoCompare

[ Source](https://github.com/netresearch/deutschepost-sdk-api-internetmarke)[ Packagist](https://packagist.org/packages/deutschepost/sdk-api-internetmarke)[ RSS](/packages/deutschepost-sdk-api-internetmarke/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (22)Versions (3)Used By (1)

Deutsche Post Internetmarke REST API SDK
========================================

[](#deutsche-post-internetmarke-rest-api-sdk)

The Deutsche Post Internetmarke REST API SDK package offers an interface to the following web services:

- [Deutsche Post Internetmarke REST API v1](https://developer.dhl.com/api-reference/deutsche-post-internetmarke)

Requirements
------------

[](#requirements)

### System Requirements

[](#system-requirements)

- PHP 8.3+ with JSON extension

### Package Requirements

[](#package-requirements)

- `netresearch/jsonmapper`: Mapper for deserialization of JSON response messages into PHP objects
- `php-http/client-common`: HTTPlug PluginClient for composable HTTP middleware
- `php-http/discovery`: Discovery service for HTTP client and message factory implementations
- `php-http/httplug`: Pluggable HTTP client abstraction
- `php-http/logger-plugin`: HTTP client logger plugin for HTTPlug
- `php-http/message`: HTTP message utilities and formatters
- `psr/http-client`: PSR-18 HTTP client interfaces
- `psr/http-factory`: PSR-17 HTTP message factory interfaces
- `psr/http-message`: PSR-7 HTTP message interfaces
- `psr/log`: PSR-3 logger interfaces

### Virtual Package Requirements

[](#virtual-package-requirements)

- `psr/http-client-implementation`: Any package that provides a PSR-18 compatible HTTP client
- `psr/http-factory-implementation`: Any package that provides PSR-17 compatible HTTP message factories
- `psr/http-message-implementation`: Any package that provides PSR-7 HTTP messages

### Development Package Requirements

[](#development-package-requirements)

- `fig/log-test`: PSR-3 logger implementation for testing purposes
- `nyholm/psr7`: PSR-7 HTTP message factory &amp; message implementation
- `php-http/mock-client`: HTTPlug mock client implementation
- `phpunit/phpunit`: Testing framework
- `phpstan/phpstan`: Static analysis tool
- `rector/rector`: Automatic refactoring tool to help with PHP upgrades
- `squizlabs/php_codesniffer`: Static analysis tool

Installation
------------

[](#installation)

```
$ composer require deutschepost/sdk-api-internetmarke
```

Uninstallation
--------------

[](#uninstallation)

```
$ composer remove deutschepost/sdk-api-internetmarke
```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit -c test/phpunit.xml
```

Features
--------

[](#features)

The Deutsche Post Internetmarke REST API SDK supports the following features:

- Retrieve API Info
- Retrieve Catalog (Page Formats, Contract Products, Motif Images)
- Create Voucher Orders (PDF and PNG)
- Request Refunds
- Retrieve User Profile
- Charge Portokasse Wallet

### Authentication

[](#authentication)

The Internetmarke REST API requires OAuth2 client credentials combined with user credentials (see [API Documentation](https://developer.dhl.com/api-reference/deutsche-post-internetmarke)):

1. The **application** is identified by a *Client ID* and *Client Secret* obtained from the [DHL API Developer Portal](https://developer.dhl.com/user/apps).
2. The **user** is identified by *username* and *password* configured in the [Deutsche Post Portokasse](https://portokasse.deutschepost.de/).

These credentials are passed to the SDK via the `ServiceFactory` constructor:

```
$serviceFactory = new \DeutschePost\Sdk\Internetmarke\Service\ServiceFactory(
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret',
    username: 'portokasse-user',
    password: 'portokasse-password',
);
```

### Retrieve Catalog

[](#retrieve-catalog)

Retrieve available page formats and contract products.

#### Public API

[](#public-api)

The library's components suitable for consumption comprise

- services:
    - service factory
    - catalog service
- data transfer objects:
    - page format (id, name, dimensions, voucher grid)
    - contract product (product code, price)
    - catalog item (motif images)

#### Usage

[](#usage)

```
$logger = new \Psr\Log\NullLogger();

$serviceFactory = new \DeutschePost\Sdk\Internetmarke\Service\ServiceFactory(
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret',
    username: 'portokasse-user',
    password: 'portokasse-password',
    logger: $logger,
);

$catalogService = $serviceFactory->createCatalogService();

$pageFormats = $catalogService->getPageFormats();
$contractProducts = $catalogService->getContractProducts();
```

### Create Voucher Order

[](#create-voucher-order)

Create voucher orders with PDF labels. Each order consists of shopping cart positions built via the `ShoppingCartPositionBuilder`.

#### Public API

[](#public-api-1)

The library's components suitable for consumption comprise

- services:
    - service factory
    - order service
    - shopping cart position builder
- data transfer objects:
    - order request
    - order (shopOrderId, walletBalance, vouchers, label PDF)
    - voucher (voucherId, trackId)
- enums:
    - `VoucherLayout` (AddressZone, FrankingZone)
    - `Dpi` (Dpi300, Dpi600, Dpi910)
    - `ShippingList` (None, Xml, Pdf)

#### Usage

[](#usage-1)

```
$logger = new \Psr\Log\NullLogger();

$serviceFactory = new \DeutschePost\Sdk\Internetmarke\Service\ServiceFactory(
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret',
    username: 'portokasse-user',
    password: 'portokasse-password',
    logger: $logger,
);

$orderService = $serviceFactory->createOrderService();

$builder = \DeutschePost\Sdk\Internetmarke\Model\ShoppingCartPositionBuilder::forPageFormat(
    pageFormatId: 1,
    columns: 2,
    rows: 5,
);

$builder->setItemDetails(productCode: 10001, price: 85);
$builder->setVoucherLayout(\DeutschePost\Sdk\Internetmarke\Api\VoucherLayout::AddressZone);
$builder->setSenderAddress(
    name: 'Sender Company',
    addressLine1: 'Senderstraße 1',
    postalCode: '04317',
    city: 'Leipzig',
    country: 'DEU',
);
$builder->setRecipientAddress(
    name: 'Jane Doe',
    addressLine1: 'Empfängerweg 2',
    postalCode: '53113',
    city: 'Bonn',
    country: 'DEU',
);

$position = $builder->create();

$orderRequest = new \DeutschePost\Sdk\Internetmarke\Model\OrderRequest(
    positions: [$position],
    total: $builder->getTotalAmount(),
    pageFormatId: 1,
);

$order = $orderService->createOrder($orderRequest);

$labelPdf = $order->getLabel();
$vouchers = $order->getVouchers();
```

### Request Refund

[](#request-refund)

Refund previously purchased vouchers.

#### Public API

[](#public-api-2)

The library's components suitable for consumption comprise

- services:
    - service factory
    - refund service
- data transfer objects:
    - refund request
    - refund voucher (voucherId, trackId)
    - refund (retoureTransactionId)
    - retoure state

#### Usage

[](#usage-2)

```
$logger = new \Psr\Log\NullLogger();

$serviceFactory = new \DeutschePost\Sdk\Internetmarke\Service\ServiceFactory(
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret',
    username: 'portokasse-user',
    password: 'portokasse-password',
    logger: $logger,
);

$refundService = $serviceFactory->createRefundService();

$refundRequest = new \DeutschePost\Sdk\Internetmarke\Model\RefundRequest(
    vouchers: [
        new \DeutschePost\Sdk\Internetmarke\Model\RefundVoucher(voucherId: 'A0011234ABC'),
    ],
);

$refund = $refundService->requestRefund($refundRequest);
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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

Unknown

Total

1

Last Release

60d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/efd68399f95aa07110668d9af1a47a8030d8df5ec5af4b28e821d442d787583a?d=identicon)[team-mage](/maintainers/team-mage)

---

Top Contributors

[![Sebastian80](https://avatars.githubusercontent.com/u/6400300?v=4)](https://github.com/Sebastian80 "Sebastian80 (6 commits)")[![CybotTM](https://avatars.githubusercontent.com/u/326348?v=4)](https://github.com/CybotTM "CybotTM (1 commits)")

---

Tags

gitlab-mirrorphpsdk

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/deutschepost-sdk-api-internetmarke/health.svg)

```
[![Health](https://phpackages.com/badges/deutschepost-sdk-api-internetmarke/health.svg)](https://phpackages.com/packages/deutschepost-sdk-api-internetmarke)
```

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M64](/packages/opensearch-project-opensearch-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)

PHPackages © 2026

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