setono/post-nord-php-sdk

A PHP SDK for the PostNord API

v2.0.0-alpha.3 2024-06-10 12:47 UTC

This package is auto-updated.

Last update: 2024-11-10 13:41:02 UTC


README

Latest Version Software License Build Status Code Coverage Mutation testing

A PHP SDK for the PostNord API.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:

composer require setono/post-nord-php-sdk

Usage

Here is an example showing you can get the nearest service points.

use Setono\PostNord\Client\Client;
use Setono\PostNord\Request\Query\ServicePoints\NearestByAddressQuery;

require_once __DIR__ . '/../vendor/autoload.php';

$client = new Client('b09ff56c6a0344768d5afaaec595b2fb');

$servicePoints = $client->servicePoints()->getNearestByAddress(NearestByAddressQuery::create(
    'Street name',
    'Street number',
    'Postal code',
    'City',
    'Country code',
    numberOfServicePoints: 10,
));

Framework integration