PHPackages                             fullscreeninteractive/silverstripe-xero - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fullscreeninteractive/silverstripe-xero

ActiveSilverstripe-vendormodule

fullscreeninteractive/silverstripe-xero
=======================================

1.2.0(2y ago)11081BSD-3-ClausePHPCI failing

Since Sep 16Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/fullscreeninteractive/silverstripe-xero)[ Packagist](https://packagist.org/packages/fullscreeninteractive/silverstripe-xero)[ Docs](https://github.com/fullscreeninteractive/silverstripe-xero)[ RSS](/packages/fullscreeninteractive-silverstripe-xero/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (6)Used By (0)

silverstripe-xero
=================

[](#silverstripe-xero)

Maintainer Contact
------------------

[](#maintainer-contact)

- Will Rossiter

Installation
------------

[](#installation)

> composer require "fullscreeninteractive/silverstripe-xero"

Documentation
-------------

[](#documentation)

Provides a lightweight wrapper around `calcinai/xero-php` with additional Silverstripe support for authenication and connecting applications via oauth.

To setup register a Xero Application and define your clientId and clientSecret as environment variables.

```
XERO_CLIENT_ID='123'
XERO_CLIENT_SECRET='123'
```

Once those API keys are available, a new tab under the `Settings` admin will appear for connecting to Xero. Follow the prompts to link the selected account to your Silverstripe website.

Renewing the Access Token
-------------------------

[](#renewing-the-access-token)

Access tokens last 30 days, a scheduled queued job (`RefreshXeroTokenJob`) is provided which renews the access token on a regular basis.

Setting up the application in Xero
----------------------------------

[](#setting-up-the-application-in-xero)

1. Head to
2. Create a new `Web App`
3. Set the `Redirect URI` to be `https://www.yoursite.com/connectXero`

Note the `connectXero` endpoint in Silverstripe is restricted to `ADMIN` only users.

Interacting with the API
------------------------

[](#interacting-with-the-api)

```
/** @var \XeroPHP\Application **/
$app = XeroFactory::singleton()->getApplication();
```

Integrating with the API is done via . Consult that page for further information for creating invoices etc.

#### Creating a Xero Contact from a Member

[](#creating-a-xero-contact-from-a-member)

```
