Type: PHP Library / Debian Package
Purpose: PHP client library for the IPEX B2B REST API — enables read/write operations on the IPEX VoIP system (customers, calls, services, SIM cards, rights, tokens)
License: MIT
Status: Active
Repository: https://github.com/Spoje-NET/ipex-b2b
Packagist: spojenet/ipexb2b
Debian package: php-spojenet-ipex-b2b
Current version: 1.2.0
- PHP >= 8.0 (ext-curl required)
- vitexsoftware/ease-core — logging, base
Brickclass - Composer (PSR-4 autoloading, namespace
IPEXB2B\) - Debian packaging (
debhelper-compat 13,pkg-php-tools) - PHPUnit, PHPStan, php-cs-fixer
ipex-b2b/
├── src/IPEXB2B/ # Library source (PSR-4, namespace IPEXB2B\)
│ ├── ApiClient.php # Base cURL/REST client; all sections extend this
│ ├── Token.php # Bearer-token authentication
│ ├── Calls.php # /calls section
│ ├── Customers.php # /customers section
│ ├── Rights.php # /rights section
│ ├── Services.php # /services section
│ └── Voip.php # /voip section (credit top-up, numbers)
├── tests/src/IPEXB2B/ # PHPUnit tests
│ ├── ApiClientTest.php
│ └── CallsTest.php
├── Examples/ # Runnable usage examples
├── debian/ # Debian packaging files
│ ├── control # Package metadata
│ ├── autoload.php # Static Debian autoloader (replaces phpab/composer-debian)
│ ├── Jenkinsfile # CI pipeline
│ └── Jenkinsfile.release
├── composer.json # Package: spojenet/ipexb2b
├── phpunit.xml
├── phpstan-default.neon.dist
└── Makefile
Set via PHP constants or pass as $options array to the constructor:
define('IPEX_URL', 'https://restapi.ipex.cz');
define('IPEX_LOGIN', 'firma_api');
define('IPEX_PASSWORD', 'secret');Constructor options override constants:
$client = new \IPEXB2B\Rights(null, [
'url' => 'https://testapi.ipex.cz',
'user' => 'resttest',
'password' => 'secret',
]);composer installmake tests
# or
vendor/bin/phpunit testsmake static-code-analysis
# regenerate baseline:
make static-code-analysis-baselinemake cs # runs php-cs-fixerdpkg-buildpackage -b -ucApiClientextendsEase\Brickand uses theEase\Logger\Loggingtrait.- Authentication is token-based (
Tokenclass, singleton viaToken::instanced()). The token is injected as anAuthorizationheader on every request. - Subclasses set
$this->sectionto the API path segment (e.g.'voip','customers').getSectionURL()builds{url}/v1/{section}. requestData($urlSuffix, $method, $format)is the main entry point for all HTTP calls.- The Debian autoloader (
debian/autoload.php) is a static file — do not regenerate it withphpaborcomposer-debian.
- REST API reference: https://restapi.ipex.cz/documentation