pixonaut / pixonaut-php
PHP SDK for the Pixonaut public API.
Requires
- php: >=8.1
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1 || ^2.0
- psr/log: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- guzzlehttp/guzzle: ^7.9
- nikic/php-parser: ^5.0
- nyholm/psr7: ^1.8
- nyholm/psr7-server: ^1.1
- opis/json-schema: ^2.4
- php-http/mock-client: ^1.6
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.5
- symfony/http-client: ^6.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-06 08:47:19 UTC
README
PHP SDK for the Pixonaut public API, for PHP integrations such as WooCommerce plugins. It depends only on the PSR HTTP and logging interfaces, so it works with any PSR-18 client, and it can be prefixed with Strauss or PHP-Scoper.
Each release targets one release of the Pixonaut API, named in its release
notes and in Pixonaut\Sdk\Generated\ApiVersion::TARGET.
Install
PHP 8.1 or newer, and any PSR-18 client with PSR-17 factories:
composer require pixonaut/pixonaut-php symfony/http-client nyholm/psr7
Use
use Nyholm\Psr7\Factory\Psr17Factory; use Pixonaut\Sdk\Config; use Pixonaut\Sdk\Credentials\StaticCredentials; use Pixonaut\Sdk\Generated\Operations; use Pixonaut\Sdk\Pixonaut; use Symfony\Component\HttpClient\Psr18Client; $factory = new Psr17Factory(); $pixonaut = new Pixonaut( new Config(product: 'my-shop/1.0'), new Psr18Client(), $factory, $factory, new StaticCredentials(integrationKey: $integrationKey), Operations::catalogue(), ); $template = $pixonaut->templates()->get('tshirt-basic@2');
Every operation is a method on its resource (templates(), designs(),
orders(), …), taking typed arguments and returning a typed model. A call
that does not succeed throws Pixonaut\Sdk\Exception\ApiException.
Documentation
- Quick start: connect a store, read templates, commit a design, handle errors and take a webhook delivery. Every snippet runs in the package's tests.
- Errors: the codes, what is retryable, and what to retry.
- Idempotency: snapshots, resends, what to store.
- Webhooks: the signature, its window, rotation, unknown events.
- Versioning: how releases are numbered and which API each targets.
Prefixing
Plugins that ship their dependencies prefix them, so two plugins with different versions do not clash. The SDK names every class statically, and each pull request prefixes the package and its dependencies with Strauss and with PHP-Scoper, then runs the quick-start and the webhook signature vectors on the prefixed copy.
Working on the package
Everything runs in Docker; the host needs no PHP or Composer.
bin/composer install # install the dependencies bin/composer check # everything a pull request runs bin/composer test # the tests only bin/composer format # fix the code style PHP_VERSION=8.5 bin/composer check # on another PHP version
See CONTRIBUTING.md for the tests, the generated code and the commit convention.