grip/pakketdienstqls

Pakketdienst QLS API Client

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/grip/pakketdienstqls

1.0.0 2025-07-05 11:31 UTC

This package is auto-updated.

Last update: 2025-12-05 12:50:40 UTC


README

This library provides a PHP client API for QLS Pakketdienst.

Installing

The library can be installed using Composer:

$ composer require grip/pakketdienstqls

Usage

Creating a client instance and get available products

$client = new \Grip\PakketdienstQls\Client($username, $password);

// determine available products and product combinations
var_dump($client->getProductsByCompanyId($companyId));

Creating a shipment

$shipment = new \Grip\PakketdienstQls\Model\Shipment();

$receiver = new \Grip\PakketdienstQls\Model\Contact();
$receiver->setName('John Doe');
$receiver->setStreet('Main Street');
$receiver->setHouseNumber('123');
$receiver->setPostalCode('1234AB');
$receiver->setLocality('Amsterdam');
$receiver->setCountry('NL');

$shipment->setReceiverContact($receiver);
$shipment->setProductId($productId);
$shipment->setProductCombinationId($productCombinationId);
$shipment->setWeight(1000); // weight in grams
$shipment->setReference('Order #12345');

// store shipment and get PDF label url
$createdShipment = $client->createShipment($companyId, $shipment);
echo $createdShipment->getLabelPdfUrl();

Retrieving a shipment to determine its shipment status

$shipment = $client->getShipmentById($companyId, $shipmentId);
// determine shipment status
$status = $shipment->getStatus();
echo $status

Find pickup location points near a postal code

// get service points near a postal code
$productId = 81; // PostNL Pakje Servicepunt
$servicePoints = $client->getServicePointsByProduct($companyId, $productId, 'NL', '2245AD');
var_dump($servicePoints);

Find companies to work with

$pageId = 1;
do {
    $companies = $client->getCompanies($pageId);
    foreach ($companies as $company) {
        var_dump($company);
    }
    $page++;
} while ($companies);

Get registered webhooks for a company

$webhooks = $client->getWebhooks($companyId);
var_dump($webhooks);

Determine webhook types and register a new webhook

$webhookTypes = $client->getWebhookTypes($companyId);
var_dump($webhookTypes);
$client->createWebhook($companyId, 'https://example.com/webhook', $webhookType);