Provides methods to integrate with the Xero Account SaaS that allows modules to create invoices and payments or read in data from Xero.

This uses Xero's private application model. You will need to follow their instructions to setup your private application for your organization. The application makes RSA-signed OAuth requests to its API.

Drupal 8 or greater

Xero API uses the xeroclient library. Drupal 8.x-2.x supports OAuth2.

API

  • Typed Data integration for Xero types including custom "view" method to print out a render array for a data type.
  • xero.query service to get, post, and put to Xero API.
  • Xero reference field to store references to Xero objects by GUID.
  • Form builder service to dynamically create forms based on Typed Data data types.
  • Templates for Xero types.
  • PHPUnit tests running off of qa.drupal.org.

Drupal 7.x-2.x

Experimental OAuth2 support is available in 7.x-2.x branch of this module.

Drupal 6, Drupal 7 1.x

Xero API uses the PHP-Xero library, and is not compatible with oauth module because of the way in which the OAuth class is included in both the module and the PHP-Xero library.

API

  • Methods: Query data, cache data, and build forms around data.
  • Make API: Create array structures for various Xero data types.
  • Theme API: Theme functions and templates for basic data types.
  • Field API: Xero reference field stores Contact, Payment, BankTransaction, Account, and Invoice Xero types (7.x-1.0-beta2 or greater)
  • Tests: Connection test and validation assertions using SimpleTest.
  • Example: See included Ubercart Xero example.

Modules that use Xero API

Xero API provides methods as described in API.txt to let you develop modules. As an example, I have used the Xero API to create addhours and addhours_xero modules (private), which post hour entries as Invoice line items to Xero. You can make any GET or POST query as defined in the Xero Developer Documentation.

As such this module actually has no visible effect other than providing methods for a module developer to use and to test their own application. I found that there is no one way that Accounting is setup per organization.

Version information

Module Version Drupal Compatibility Library Compatibility
3.0.x 10 xeroclient >= 0.4
8.x-2.x 8, 9 xeroclient < 0.4 >= 0.3
7.x-2.x 7 xeroclient (included)
7.x-1.x 7 No longer compatible with Xero API
Supporting organizations: 
Development

Project information

Releases