servality / xero
Xero API wrapper
dev-master
2019-03-25 10:00 UTC
Requires
- php: >7.0.0
- ext-simplexml: *
- guzzlehttp/guzzle: ^6.2
- guzzlehttp/oauth-subscriber: ^0.3.0
This package is auto-updated.
Last update: 2024-12-04 15:12:34 UTC
README
Requirements
- PHP 7+
- guzzlehttp/guzzle
- guzzlehttp/oauth-subscriber
Introduction
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.
Installation
Recommended installation is through Composer.
console:
composer require servality/xero:dev-master
or add to composer.json:
{ "require": { "servality/xero": "dev-master" } }
Prerequisites
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.
Usage
Basic usage
$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();
Filtering
$xero->contacts()->where('name.contains("Mark")')->get();
Xml Helper
This package included and XML Helper class for converting an array to xml.
See wiki Page for details.
License
Open-sourced software licensed under the MIT license.