PHPackages                             everbinding/econnect-psb-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. everbinding/econnect-psb-php

ActiveLibrary[API Development](/categories/api)

everbinding/econnect-psb-php
============================

PHP example implementation for using the Procurement Service Bus.

v0.9.2(4y ago)6290↓92.9%4unlicensePHPPHP &gt;=7.2

Since Aug 2Pushed 3y ago3 watchersCompare

[ Source](https://github.com/everbinding/econnect-psb-php)[ Packagist](https://packagist.org/packages/everbinding/econnect-psb-php)[ Docs](https://psb.econnect.eu)[ RSS](/packages/everbinding-econnect-psb-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

PHP Client
==========

[](#php-client)

A reference implementation meant as an example how to use the PSB api using PHP.

Requirements
------------

[](#requirements)

- PHP 7.2 or greater

Install
-------

[](#install)

- Install library using [`composer`](https://getcomposer.org/).

```
composer require everbinding/econnect-psb-php
```

Then include composer autoloader.

```
require __DIR__ . '/vendor/autoload.php';
```

Configure
---------

[](#configure)

```
$config = \EConnect\Psb\Configuration::getDefaultConfiguration();

$config
    ->setUsername("{username}")
    ->setPassword("{password}");
    ->setClientId("{clientId}")
    ->setClientSecret("{clientSecret}")
    ->setHost("https://psb.econnect.eu")
    ->setApiKey('Subscription-Key', '{subscription key}');
```

Login
-----

[](#login)

Login using the default configuration.

```
$config = \EConnect\Psb\Configuration::getDefaultConfiguration();

$authN = new \EConnect\Psb\Authentication($config);
$authN->login();
```

Use api
-------

[](#use-api)

Use the api using the default configuration after a successful login. In this example we are calling the send sales invoice api. The user must have send permission on the provide sender [`partyId`](https://psb.econnect.eu/misc/partyIds.html). Also make sure the UBL is valid, otherwise it will be block for sending. The receiver [`partyId`](https://psb.econnect.eu/misc/partyIds.html) is optional, the PSB will use the best possible route we no receiver partyId is provided.

```
$config = \EConnect\Psb\Configuration::getDefaultConfiguration();

$salesInvoiceApi = new EConnect\Psb\Api\SalesInvoiceApi(
    new GuzzleHttp\Client();
    $config
);

$yourPartyId = "senderPartyId";
$filePath = "./Ubl.xml";
$receiverPartyId = null;

$salesInvoiceApi->sendSalesInvoice($yourPartyId, $filePath, $receiverPartyId);
```

Example client
--------------

[](#example-client)

There is a [`simple example php client`](./ExampleSendInvoice.php) that you can run on a php webserver. With the example you can [`send an invoice via Peppol`](https://psb.econnect.eu/introduction/sendInvoice.html). Also there is a [`webhook receiver example`](./ExampleWebhookReceiver.php) that you need to have in order to [`receive invoices from Peppol`](https://psb.econnect.eu/introduction/receiveInvoice.html).

Build your own source
---------------------

[](#build-your-own-source)

Instead of using this code, you could also generate the php code yourself using the [`openapi-generator-cli`](https://github.com/OpenAPITools/openapi-generator-cli).

```
openapi-generator-cli generate -g php -i https://psb.econnect.eu/v1/swagger.json?subscriptionKey={your-subscription} -o C:\temp --additional-properties=invokerPackage=EConnect\Psb
```

And use [`Jumbojett\OpenIDConnectClient`](https://github.com/jumbojett/OpenID-Connect-PHP#example-5-request-resource-owners-token-with-client-auth) to get the access token. You can also copy the code from: [`Authentication.php`](./lib/Authentication.php)

```
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient('https://identity.econnect.eu',
                                '{clientId}',
                                '{clientSecret}');

$oidc->addScope('ap');

// Add username and password
$oidc->addAuthParam(array('username'=>'{username}'));
$oidc->addAuthParam(array('password'=>'{password}'));

// to validate the JWT and whether the acces_token property is present
$token = $oidc->requestResourceOwnerToken(TRUE)->access_token;
```

Read more
---------

[](#read-more)

If you want to know more about Peppol e-procurement or other procurement network the go to the [`Procurement Service Bus introduction page`](https://psb.econnect.eu/introduction/overview.html).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1796d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14226472?v=4)[econnect](/maintainers/econnect)[@econnect](https://github.com/econnect)

---

Top Contributors

[![ThiemeNL](https://avatars.githubusercontent.com/u/5397828?v=4)](https://github.com/ThiemeNL "ThiemeNL (7 commits)")

---

Tags

econnectpeppolpeppoleconnectpsb

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/everbinding-econnect-psb-php/health.svg)

```
[![Health](https://phpackages.com/badges/everbinding-econnect-psb-php/health.svg)](https://phpackages.com/packages/everbinding-econnect-psb-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M45](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
