ccvshop/econnect-psb-php

CCV Shop implementation for the PSB of econnect.

Maintainers

Package info

github.com/ccvshop/E-Connect-PSB

pkg:composer/ccvshop/econnect-psb-php

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.4 2026-03-31 12:22 UTC

This package is auto-updated.

Last update: 2026-03-31 12:23:08 UTC


README

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

Requirements

  • PHP 7.2 or greater

Install

composer require ccvshop/econnect-psb-php

Then include composer autoloader.

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

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 using the default configuration.

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

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

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. Also make sure the UBL is valid, otherwise it will be block for sending. The receiver partyId 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

There is a simple example php client that you can run on a php webserver. With the example you can send an invoice via Peppol. Also there is a webhook receiver example that you need to have in order to receive invoices from Peppol.