PHP client library for Kill Bill
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


build status

PHP client library for Killbill


In order to use the library, you need to:

  1. Require the library via composer: composer require killbill\killbill-client
  2. Point the library to your Killbill instance via the Client::$serverUrl variable ( by default)


The following snippet will create an account:


use \Killbill\Client\Client;
use \Killbill\Client\Tenant;
use \Killbill\Client\Account;

// Killbill server
Client::$serverUrl = 'http://localhost:8080';

// Set these values for your particular tenant
$tenant = new Tenant();

// Unique id for this account
$externalAccountId = uniqid();

// Prepare the account data
$accountData = new Account();
$accountData->setName('Killbill php test');
$accountData->setEmail('test-' . $externalAccountId . '');
$accountData->setAddress1('12 rue des ecoles');
$accountData->setPhone('81 53 26 56');

// Create it
$createdAccount = $accountData->create('pierre', 'PHP_TEST', 'Test for '' . $externalAccountId, $tenant->getTenantHeaders());

Using the client in a non-composer environment

If you want to use the client but are not using Composer (yet), follow these steps:

  • Install composer locally: Instruction
  • Run composer require killbill/killbill-client. This will download the library into the vendor/ folder and create a composer.json and a composer.lock file that define this dependency.
  • Include the auto-generated autoload.php file from the vendor/ folder.
  • You can now use the client like above described.
  • If you don't want to have an additional build step, just check the vendor/ folder into your repository.


The Killbill PHP client uses phpunit as testing framework. Tests can either be run locally using composer test or against a live Killbill instance that is running on using composer test-integration.


The PHP library requires PHP 5.5 or greater with libcurl compiled (e.g. you need the php-curl package on Ubuntu).


Feel free to ask questions on the killbilling-users Google Group.