PHPackages                             pennyblack/php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pennyblack/php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pennyblack/php-sdk
==================

Penny Black PHP SDK

1.5.0(2y ago)02.6k[1 PRs](https://github.com/stordco/unbox-php-sdk/pulls)1MITPHPPHP &gt;=7.2.0CI passing

Since Mar 30Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/stordco/unbox-php-sdk)[ Packagist](https://packagist.org/packages/pennyblack/php-sdk)[ RSS](/packages/pennyblack-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (9)Versions (19)Used By (1)

Penny Black PHP SDK
===================

[](#penny-black-php-sdk)

This client library introduces a reusable API interface for PHP applications to communicate with the Penny Black platform. The SDK wraps up methods to simplify making requests, authorization, error handling and provides guidance of the available parameters via models. It follows the PSR-7, PSR-17 and PSR-18 standards, relying on proven external libraries to provide the HTTP client and message factories.

For development, we have bundled in Guzzle, but you are free to choose your own, or use the client included with your platform, as long as it supports these standards.

See the [Penny Black API documentation](https://pennyblack.stoplight.io/docs/pennyblack/) for full details of the available end-points.

Prerequisites
-------------

[](#prerequisites)

- PHP &gt;=7.4
- Composer

Installation
------------

[](#installation)

For production environments you can include the library as a dependency in your project using composer.

```
composer require pennyblack/php-sdk
```

You will also need to ensure you have packages that satisfy the virtual `psr/http-client-implementation` and `psr/http-factory-implementation` requirements. If you do not, then you can require Guzzle, which will satisfy both:

```
composer require guzzlehttp/guzzle
```

Usage
-----

[](#usage)

See the [example](example) folder for working examples of how to use the library.

### Creating an API instance

[](#creating-an-api-instance)

You will need an API key to access Penny Black services. If you have a test environment setup then you can set the `$isTest` flag to true to make requests against our test servers. For most customers we only offer production accounts.

The example below uses Guzzle, but you can use any PSR-18 compatible HTTP client, see the package options [here](https://packagist.org/providers/psr/http-client-implementation) and [here](https://packagist.org/providers/psr/http-factory-implementation).

```
