Download the PHP package slightlydiff/yii2-xero without Composer
On this page you can find all versions of the php package slightlydiff/yii2-xero. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download slightlydiff/yii2-xero
More information about slightlydiff/yii2-xero
Files in slightlydiff/yii2-xero
Package yii2-xero
Short Description An extension for using the Xero API from within Yii2
License Apache-2.0
Informations about the package yii2-xero
Xero API for Yii2
An extension for using the Xero API from within Yii2.
This extension is based on Xero's XeroOAuth-PHP code at https://github.com/XeroAPI/XeroOAuth-PHP
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Configuration
Add the following to your application conmfiguration file:
modifying the above for your own Xero consumer key, shared secret and the path to you public / private key pair.
Usage
For a GET request:
- The first parameter is the only required parameter and must be 'GET', 'POST', 'PUT' or 'DELETE'
- The second parameter can be FALSE or a string ID if you want to get a single record by ID
- The third parameter can be a date/time, in any format, if you want to fetch all records modified since that date
- The fourth parameter can be an array of filters as described at https://developer.xero.com/documentation/getting-started/http-requests-and-responses/. This allows you to filter the query and order the returned data.
All parameters are optional except the first. If not parameters are passed then all records of the requested type will be returned
For a POST or PUT request:
- The first parameter must be the method, as above, and the second param must be a multidimensional array of the data being passed as in the examples below.
To create a contact see https://developer.xero.com/documentation/api/contacts/ for the format and apply as follows:
To create a invoice or credit note see https://developer.xero.com/documentation/api/invoices/ for the format and apply as follows:
To create a payment see https://developer.xero.com/documentation/api/payments/ for the format and apply as follows:
To get details of an account with the name "Joe Bloggs"
See https://developer.xero.com/documentation/api/accounts/ for a list of all parameters.
To get details of all contacts
To get details of all contacts modified in the last 24 hours
To get details of a contact by ID
To get details of all contacts whos name contains "Bloggs" and order the results by Name