In agreement with Deutsche Post Direkt GmbH, the ADDRESSFACTORY and AUTOCOMPLETE modules have been discontinued and are entering end-of-life.
- No new customers will be onboarded for these modules by Deutsche Post Direkt.
- Existing customers may continue to access the GitHub source code until approximately June 2027.
- Official support for existing users will end on December 31, 2026.
The Postdirekt Addressfactory API SDK package offers an interface to the ADDRESSFACTORY DIRECT web service which allows to correct and enrich address datasets.
- PHP 8.1+ with SOAP extension
psr/log: PSR-3 logger interfaces
phpstan/phpstan: Static analysis toolphpunit/phpunit: Testing frameworksquizlabs/php_codesniffer: Static analysis toolrector/rector: Refactoring toolfig/log-test: Test utilities forpsr/log
composer require deutschepost/sdk-api-addressfactorycomposer remove deutschepost/sdk-api-addressfactorycomposer run testThe Postdirekt Addressfactory API SDK supports the following features:
- Get address record by flat address data
- Get address record(s) by complex address data
Verify a single address record by passing name and street address.
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
$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', '…']Verify address records by passing in a complex request objects.
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
$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', '…']
}