Search by

deutschepost / sdk-api-addressfactory

team-mage

PostDirekt Addressfactory API

Package info

github.com/netresearch/deutschepost-sdk-addressfactory

pkg:composer/deutschepost/sdk-api-addressfactory

Statistics

Installs: 441 166

Dependents: 2

Suggesters: 0

Stars: 5

Open Issues: 0

2.2.0 2025-06-04 15:54 UTC

This package is auto-updated.

Last update: 2026-11-10 03:15:00 UTC


README

Deprecation Notice

The Deutsche Post Direkt service ADDRESSFACTORY DIRECT itself is not affected and remains available for booking.

Only this SDK, used by the Magento 2 module and the Shopware 6 plugin, is being discontinued. In agreement with Deutsche Post Direkt GmbH, Netresearch ends development and support for it:

  • This SDK is no longer offered to new customers.
  • Official support for existing users of this SDK ends on December 31, 2026.
  • The source code remains available on GitHub until approximately June 2027.

The Postdirekt Addressfactory API SDK package offers an interface to the ADDRESSFACTORY DIRECT web service which allows to correct and enrich address datasets.

Requirements

System Requirements

  • PHP 8.1+ with SOAP extension

Package Requirements

  • psr/log: PSR-3 logger interfaces

Development Package Requirements

  • phpstan/phpstan: Static analysis tool
  • phpunit/phpunit: Testing framework
  • squizlabs/php_codesniffer: Static analysis tool
  • rector/rector: Refactoring tool
  • fig/log-test: Test utilities for psr/log

Installation

composer require deutschepost/sdk-api-addressfactory

Uninstallation

composer remove deutschepost/sdk-api-addressfactory

Testing

composer run test

Features

The Postdirekt Addressfactory API SDK supports the following features:

  • Get address record by flat address data
  • Get address record(s) by complex address data

Get Record By Address

Verify a single address record by passing name and street address.

Public API

The library's components suitable for consumption comprise of

  • service:
    • service factory
    • address verification service
  • data transfer objects:
    • response record with corrections and status codes indicating issues with the input data

Usage

$logger = new \Psr\Log\NullLogger();
$configName = 'default';

$serviceFactory = new \PostDirekt\Sdk\AddressfactoryDirect\Service\ServiceFactory();
$service = $serviceFactory->createAddressVerificationService('user', 'pass', $logger);

$record = $service->getRecordByAddress('53114', 'Bonn', 'Sträßchenweg', '10', 'Mustermann', 'Hans', null, $configName);

echo $record->getAddress()->getPostalCode(); // "53113"
echo $record->getAddress()->getStreetName(); // "Sträßchensweg"
echo $record->getStatusCodes(); // ['BAC100103', 'FNC400501', 'PDC030105', '…']

Get Records By Complex Address

Verify address records by passing in a complex request objects.

Public API

The library's components suitable for consumption comprise of

  • service:
    • service factory
    • address verification service
    • data transfer object builder
  • data transfer objects:
    • response record with corrections and status codes indicating issues with the input data

Usage

$logger = new \Psr\Log\NullLogger();
$configName = 'default';

$serviceFactory = new \PostDirekt\Sdk\AddressfactoryDirect\Service\ServiceFactory();
$service = $serviceFactory->createAddressVerificationService('user', 'pass', $logger);

$requestBuilder = new \PostDirekt\Sdk\AddressfactoryDirect\RequestBuilder\RequestBuilder();
$requestBuilder->setMetadata($recordId = 1);
$requestBuilder->setAddress('Deutschland', '53114', 'Bonn', 'Sträßchenweg', '10');
$request = $requestBuilder->create();

$records = $service->getRecords([$request], null, $configName);
foreach ($records as $record) {
    echo $record->getRecordId(); // 1
    echo $record->getAddress()->getPostalCode(); // "53113"
    echo $record->getAddress()->getStreetName(); // "Sträßchensweg"
    echo $record->getStatusCodes(); // ['BAC100103', 'FNC400501', 'PDC030105', '…']
}