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

ArchivedLibrary[API Development](/categories/api)

deutschepost/sdk-api-oneclickforapp
===================================

Deutsche Post INTERNETMARKE 1C4A API SDK

1.3.0(11mo ago)1200.8k↓22.4%MITPHPPHP ^8.1.0

Since Jan 26Pushed 2mo ago7 watchersCompare

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

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

> **⚠️ DEPRECATED:** This package is abandoned and no longer maintained. Use [`deutschepost/sdk-api-internetmarke`](https://github.com/netresearch/deutschepost-sdk-api-internetmarke) instead.

Deutsche Post INTERNETMARKE 1C4A API SDK
========================================

[](#deutsche-post-internetmarke-1c4a-api-sdk)

The DP OneClickForApp API SDK package offers an interface to the following web services:

- OneClickForApp V3

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

[](#requirements)

### System Requirements

[](#system-requirements)

- PHP 8.1+ with SOAP extension

### Package Requirements

[](#package-requirements)

- `psr/log`: PSR-3 logger interfaces

### Suggested Libraries

[](#suggested-libraries)

- `zf1s/zend-pdf`: PDF library to extract individual voucher PDF documents from multi-label response

### Development Package Requirements

[](#development-package-requirements)

- `phpunit/phpunit`: Testing framework

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

[](#installation)

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

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

[](#uninstallation)

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

Testing
-------

[](#testing)

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

Features
--------

[](#features)

The DP OneClickForApp API SDK supports the following features:

- Retrieve page formats
- Retrieve contract products
- Create *Internetmarke* postal stamp in PDF format

The main feature is to order *Internetmarke* vouchers via the Deutsche Post AG OneClickForApplication web service interface. The web service request requires details about the ordered shipping products as well as the page dimensions of the resulting PDF document.

The full process is outlined as follows:

- Retrieve available shipping products from the separate products web service ([`deutschepost/sdk-api-prodws`](https://packagist.org/packages/deutschepost/sdk-api-prodws))
- Replace general product prices by individually contracted prices ([Retrieve Contract Products](#retrieve-contract-products))
- Retrieve available print formats ([Retrieve Page Formats](#retrieve-page-formats))
- Order voucher(s) for one of the page formats, specifying one of the shipping products (identifier and price) per order position

The web service requires an authentication token for some operations. The library retrieves a token but discards it after the process terminates. In order to reuse the token, a persistent storage can be passed in ([Persist Authentication Token](#persist-authentication-token)).

### Retrieve Page Formats

[](#retrieve-page-formats)

Load the list of page formats that the ordered *Internetmarke* vouchers can be printed on. The print formats differ in layout characteristics and come with different capabilities.

#### Public API

[](#public-api)

The library's components suitable for consumption comprise

- services:
    - application token storage
    - service factory
    - account information service
- data transfer objects:
    - credentials
    - page format

#### Usage

[](#usage)

```
$logger = new \Psr\Log\Test\TestLogger();
$tokenStorage = new \DeutschePost\Sdk\OneClickForApp\Auth\TokenStorage();
$credentials = new \DeutschePost\Sdk\OneClickForApp\Auth\Credentials(
    $username = '', // page formats are public, no user auth needed
    $password = '',
    $partnerId = 'PARTNER_ID',
    $partnerKey = 'SCHLUESSEL_DPWN_MEINMARKTPLATZ',
    $keyPhase = 1,
    $tokenStorage
);

$serviceFactory = new \DeutschePost\Sdk\OneClickForApp\Service\ServiceFactory();
$service = $serviceFactory->createAccountInformationService($credentials, $logger);
$pageFormats = $service->getPageFormats();

// work with the web service response, e.g. drop page formats that cannot print addresses
$pageFormatsWithAddress = array_filter(
    $pageFormats,
    static function (\DeutschePost\Sdk\OneClickForApp\Api\Data\PageFormatInterface $pageFormat) {
        return $pageFormat->isAddressPossible();
    }
);
```

### Retrieve Contract Products

[](#retrieve-contract-products)

When ordering *Internetmarke* vouchers, the price of the selected shipping product must be included with the request. If the submitted product price does not match the price list, then the web service rejects the request.

The correct price is either retrieved from the official "Produkte- und Preisliste" (PPL) via [ProdWS API SDK](https://packagist.org/packages/deutschepost/sdk-api-prodws)or, if available, from the user's contract.

#### Public API

[](#public-api-1)

The library's components suitable for consumption comprise

- services:
    - application token storage
    - service factory
    - account information service
- data transfer objects:
    - credentials
    - contract product

#### Usage

[](#usage-1)

```
$logger = new \Psr\Log\Test\TestLogger();
$tokenStorage = new \DeutschePost\Sdk\OneClickForApp\Auth\TokenStorage();
$credentials = new \DeutschePost\Sdk\OneClickForApp\Auth\Credentials(
    $username = 'max.mustermann@example.com',
    $password = 'portokasse321',
    $partnerId = 'PARTNER_ID',
    $partnerKey = 'SCHLUESSEL_DPWN_MEINMARKTPLATZ',
    $keyPhase = 1,
    $tokenStorage
);

$serviceFactory = new \DeutschePost\Sdk\OneClickForApp\Service\ServiceFactory();
$service = $serviceFactory->createAccountInformationService($credentials, $logger);

// work with the web service response, e.g. replace PPL prices
foreach ($service->getContractProducts() as $contractProduct) {
    $prodWsProduct = $this->productRepository->get($pplId = $contractProduct->getId());
    $prodWsProduct->setPrice($contractProduct->getPrice());
    $this->productRepository->save($prodWsProduct);
}
```

### Create Postal Stamp

[](#create-postal-stamp)

Order *Internetmarke* vouchers for a page format. If multiple vouchers are requested with one service call, then the web service will create all vouchers in one PDF file. The library attempts to split the original document and return one label per voucher. This only works for certain page formats and, for technical reasons, results in a larger total file size.

#### Public API

[](#public-api-2)

The library's components suitable for consumption comprise

- services:
    - application token storage
    - service factory
    - order service
    - data transfer object builder
- data transfer objects:
    - credentials
    - order with vouchers

#### Usage

[](#usage-2)

```
$logger = new \Psr\Log\Test\TestLogger();
$tokenStorage = new \DeutschePost\Sdk\OneClickForApp\Auth\TokenStorage();
$credentials = new \DeutschePost\Sdk\OneClickForApp\Auth\Credentials(
    $username = 'max.mustermann@example.com',
    $password = 'portokasse321',
    $partnerId = 'PARTNER_ID',
    $partnerKey = 'SCHLUESSEL_DPWN_MEINMARKTPLATZ',
    $keyPhase = 1,
    $tokenStorage
);

// init a new builder for every order
$orderItemBuilder = \DeutschePost\Sdk\OneClickForApp\Model\ShoppingCartPositionBuilder::forPageFormat($pageFormatsWithAddress[0]);

// create as many items as needed per order
$orderItemBuilder->setItemDetails($prodWsProduct->getPPLId(), $prodWsProduct->getPrice());
$orderItemBuilder->setShipperAddress(
    $shipperCompany = 'DHL',
    $shipperCountry = 'DEU',
    $shipperPostalCode = '53113',
    $shipperCity = 'Bonn',
    $shipperStreetName = 'Charles-de-Gaulle-Straße',
    $shipperStreetNumber = '20',
    $shipperLastName = 'Doe',
    $shipperFirstName = 'John'
);

$orderItemBuilder->setRecipientAddress(
    $recipientLastName = 'Doe',
    $recipientFirstName = 'Jane',
    $recipientCountry = 'DEU',
    $recipientPostalCode = '53113',
    $recipientCity = 'Bonn',
    $recipientStreet = 'Sträßchensweg',
    $recipientStreetNumber = '2',
    null,
    null,
    $recipientCompany = 'DP'
);

$serviceFactory = new \DeutschePost\Sdk\OneClickForApp\Service\ServiceFactory();
$orderService = $serviceFactory->createOrderService($credentials, $logger);
$order = $orderService->createOrder(
    [$orderItemBuilder->create()],
    $orderItemBuilder->getTotalAmount(),
    $orderItemBuilder->getPageFormatId()
);

// work with the web service response, e.g. persist label
file_put_contents("/tmp/{$order->getId()}.pdf", $order->getLabel());
foreach ($order->getVouchers() as $voucher) {
    if ($voucher->getLabel()) {
        file_put_contents("/tmp/{$voucher->getVoucherId()}.pdf", $voucher->getLabel());
    }
}
```

### Persist Authentication Token

[](#persist-authentication-token)

To reuse a token during its lifetime, the credentials object can be created with a custom token storage. Implement access to a database, cache, or any other suitable source.

#### Usage

[](#usage-3)

```
// PersistentTokenStorage implements \DeutschePost\Sdk\OneClickForApp\Api\TokenStorageInterface
$tokenStorage = new \My\OneClickForApp\Auth\PersistentTokenStorage();
$credentials = new \DeutschePost\Sdk\OneClickForApp\Auth\Credentials(
    $username = 'max.mustermann@example.com',
    $password = 'portokasse321',
    $partnerId = 'PARTNER_ID',
    $partnerKey = 'SCHLUESSEL_DPWN_MEINMARKTPLATZ',
    $keyPhase = 1,
    $tokenStorage
);
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance71

Regular maintenance activity

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~397 days

Total

5

Last Release

347d ago

PHP version history (3 changes)1.0.0PHP ^7.1

1.1.0PHP ^7.2.0 || ^8.0.0

1.2.0PHP ^8.1.0

### 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 (10 commits)")[![mam08ixo](https://avatars.githubusercontent.com/u/1771622?v=4)](https://github.com/mam08ixo "mam08ixo (8 commits)")

---

Tags

phpsdksoapinternetmarkedp1c4a

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[alexacrm/php-crm-toolkit

PHP Toolkit for Microsoft Dynamics CRM

109293.3k1](/packages/alexacrm-php-crm-toolkit)[paddlehq/paddle-php-sdk

Paddle's PHP SDK for Paddle Billing.

53301.7k](/packages/paddlehq-paddle-php-sdk)

PHPackages © 2026

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