- PHP 7+
- guzzlehttp/guzzle
- guzzlehttp/oauth-subscriber
This application was written as a simple Xero API wrapper for use in a laravel application. At this stage, support is only available for private applications.
Recommended installation is through Composer.
console:
composer require servality/xero:dev-master
or add to composer.json:
{
"require": {
"servality/xero": "dev-master"
}
}
A Xero organisation is required to use the API. It's recommended a demo company is created for testing. Follow the steps at Xero Developer to create a private application.
$config = [
'oauth' => [
'consumer_key' => 'appication_consumer_key',
'consumer_secret' => 'appication_consumer_secret',
'private_key_file' => 'path/to/private_key.pem',
'private_key_passphrase' => 'passphrase'
],
'response' => 'json', //json or xml
'user_agent' => 'application_name'
]
$xero = new XeroApplication($config);
$xero->invoices()->get();
$xero->contacts()->where('name.contains("Mark")')->get();
This package included and XML Helper class for converting an array to xml.
See wiki Page for details.
Open-sourced software licensed under the MIT license.