avido/postnl-cif-rest-api-php-client

A PHP Client for the Post NL Webservices

0.4.6 2019-11-20 14:29 UTC

This package is auto-updated.

Last update: 2024-11-14 18:34:44 UTC


README

Build Status Latest Stable Version Total Downloads License

PostNL CIF Rest Webservices API Client for PHP

Open source PHP client for the [PostNL Rest CIF Webservices] (https://developer.postnl.nl/).

Installation

Get it with composer

Run the command:

composer require avido/postnl-cif-rest-api-php-client

client initialization:

require __DIR__ . '/vendor/autoload.php';
use Avido\PostNLCifClient\CifApi;

$apikey = '--YOUR APIKEY --';
$client = new CifApi($apiKey);

Example: Retrieve nearest locations based on address information

use Avido\PostNLCifClient\Request\DeliveryOptions\Locations\NearestLocationsRequest;

// get nearest locations based on address information
$request = new NearestLocationsRequest();
$request->setCountryCode('NL')
    ->setPostalcode('2132WT')
    ->setCity('Hoofddorp')
    ->setStreet('Siriusdreef')
    ->setHouseNumber(42)
    ->setDeliveryDate('01-01-2999')
    ->setOpeningTime('09:00:00')
    ->addDeliveryOptions('PG');
// load api "getAPI" based on required services.
$response = $client->getAPI('location')->getNearestLocations($request);

Unit tests

<phpunit>
  ...
    <php>
        <env name="PHP_APIKEY" value="--YOUR APIKEY--"/>
    </php>
</phpunit>

Implementation Status

This library is still in development, new releases / implementations will follow.

Delivery Options

Deliverydate webservice

Send & Track

Barcode webservice

Fraud Prevention

IBAN Check National

Kreditcheck Zakelijk

Customer overview

Bedrijfscheck Nationaal

Mail