PHPackages                             grim-reapper/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. grim-reapper/xero

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

grim-reapper/xero
=================

XERO Auth2 integration

1.1.0(4y ago)07MITPHPPHP ^7.3|^8.0

Since Nov 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/grim-reapper/xero)[ Packagist](https://packagist.org/packages/grim-reapper/xero)[ RSS](/packages/grim-reapper-xero/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

\#Xero OAuth2.0 API Integration

> This package is just created to use in personal project, so all the function implemented according to our personal project. Please check this before use it.

```
// To use this package you have to extend it, create your own PHP class and extend this.
class YourClassName extends \GrimReapper\Xero\Xero{
    // then override it constructor
    public function __construct(array $params)
    {
        if(!empty($params)) {
            parent::__construct($params['client_id'], $params['client_secret'], $params['redirect_uri']);
        }
    }
   // that's it
}
```

Create your class object first

```
    $object = new YourClassName();
```

To get Authorize URL

```
    $data = $object->getAuthorizeURL();
    // it will return array containing URL and State Code
    $state = $data['state']; // this is used to verify state after api redirect to prevent xss
    $url = $data['url']; // use this url to redirect to Xero website for Authentication
```

To add scopes

```
    $object->setScopes(['scope1','scope2']);
```

To get Access Token after redirection to your site

```
    $code = $_GET['code']; // get code param from url and pass it to function
    $accessToken = $object->getAccessToken($code);
```

To create contact

```
    $contact = $object->createContact(array $contactData);
```

To get a contact

```
    $contact = $object->getContact(string $emailAddress);
```

To create an invoice

```
    $invoice = $object->createInvoice(array $invoiceData);
```

To create a Payment

```
    $payment = $object->createPayment($invoiceID, $account_code, $amount, $date);
```

To create a Credit Note

```
    $creditNote = $object->createCreditNotes(array $creditNotesData, bool $returnObj = false);
```

To make Credit Note Payment

```
    $creditNote = $object->createCreditNotePayment(array $paymentData);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1640d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7252105628ffa6f064585370161626c7c72e68dd2e74ee66aa50d5894543c183?d=identicon)[webz2feel](/maintainers/webz2feel)

---

Top Contributors

[![grim-reapper](https://avatars.githubusercontent.com/u/7957389?v=4)](https://github.com/grim-reapper "grim-reapper (7 commits)")

### Embed Badge

![Health badge](/badges/grim-reapper-xero/health.svg)

```
[![Health](https://phpackages.com/badges/grim-reapper-xero/health.svg)](https://phpackages.com/packages/grim-reapper-xero)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
