Search by

inserve / dsd-contract-management-api-php

inserve-paul

There is no license information available for the latest version (0.2) of this package.

A PHP client for the DSD Contract Management API

Package info

github.com/inserveit/dsd-contract-management-api-php

pkg:composer/inserve/dsd-contract-management-api-php

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.2 2026-10-22 08:01 UTC

This package is auto-updated.

Last update: 2026-10-22 08:17:34 UTC


README

A PHP 8.4+ wrapper for the DSD Contract Management API v1. Also supports listing and retrieving clients from the DSD End Client API v1.

Method Endpoint Client method
GET /v1/contracts $api->contracts()->list()
GET /v1/contracts/{id} $api->contracts()->get($id)
GET /v1/products $api->products()->list()
GET /v1/products/{sku} $api->products()->get($sku)
GET /v1/end-clients $api->endClients()->list()
GET /v1/end-clients/{clientId} $api->endClients()->get($clientId)

The documentation specifies bearer authentication and does not document a token issuance or refresh endpoint. Obtain your token from DSD.

Installation

composer require inserve/dsd-contract-management-api-php`

Inject the client into a controller, service, or job:

use Inserve\DSDContractManagementAPI\DSDContractManagementAPIClient;
use Inserve\DSDContractManagementAPI\Options\ContractFilters;

$token = 'access.token';
$api = DSDContractManagementAPIClient::create(accessToken: $token);

var_dump($api->contracts()->list(offset: 0, limit: 1));

End-client requests use https://end-client-api.dsdeurope.com and share the access token with contracts and products, including updates through setAccessToken(). The existing baseUri option still applies to contracts and products; use endClientBaseUri in create() or the injected APIClient to override the end-client origin.

use Inserve\DSDContractManagementAPI\Options\EndClientFilters;

$page = $api->endClients()->list(
    offset: 0,
    limit: 20,
    filters: new EndClientFilters(active: true, company: 'Example BV'),
);
$client = $api->endClients()->get(7);

foreach ($api->endClients()->all(new EndClientFilters(country: 'NL')) as $client) {
    echo $client->getName();
}

EndClientFilters supports active, name, firstName, lastName, company, postalCode, city, country, phone, email, numberCoc, and numberVat. List responses expose getResult() and getPagination(); all() fetches pages lazily.

Development

composer install
composer test