PHPackages                             willscottuk/monzo-php - 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. [API Development](/categories/api)
4. /
5. willscottuk/monzo-php

ActiveLibrary[API Development](/categories/api)

willscottuk/monzo-php
=====================

An API client for Monzo Bank (https://monzo.com)

v0.12.3(1y ago)02[1 issues](https://github.com/cronxco/monzo-php/issues)[2 PRs](https://github.com/cronxco/monzo-php/pulls)BSD-3-ClausePHPPHP &gt;=7.1CI failing

Since Feb 22Pushed 1mo agoCompare

[ Source](https://github.com/cronxco/monzo-php)[ Packagist](https://packagist.org/packages/willscottuk/monzo-php)[ RSS](/packages/willscottuk-monzo-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (27)Used By (0)

Monzo PHP Client
================

[](#monzo-php-client)

[ ![](https://camo.githubusercontent.com/3ccb369c391c8e211930340c59f636a3fc01976d614208f8cd942cd577b38798/68747470733a2f2f7472617669732d63692e6f72672f616d656c6961696b6564612f6d6f6e7a6f2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ameliaikeda/monzo-php)[ ![](https://camo.githubusercontent.com/f35c256612c889958aafbc92ba44ba109d50e5d9056ec3422f360d8ac8ef02a4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616d656c6961696b6564612f6d6f6e7a6f2d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ameliaikeda/monzo-php/?branch=master)[ ![](https://camo.githubusercontent.com/99150383d39f9098d470452ada96732ddc727c127dae88d41387dae48f9e8747/68747470733a2f2f7374796c6563692e696f2f7265706f732f38323834393332362f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/82849326)[ ![](https://camo.githubusercontent.com/b9008280ea195911acce510eedf2d41cac5d3c076b4402696905c4295056cc0e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35373666636434303264376266626537633034332f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/ameliaikeda/monzo-php/maintainability)

This library allows access to the [Monzo](https://monzo.com) API in PHP. This library requires PHP 7.1+.

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

[](#installation)

```
composer require amelia/monzo-php

```

If you don't already have your own access tokens from completing oauth yourself, you'll need to also `composer require laravel/socialite`.

You should set the following variables in your `.env` (or otherwise):

- `MONZO_CLIENT_ID`
- `MONZO_CLIENT_SECRET`
- `MONZO_REDIRECT_URI`

You should add the following to your `config/services.php` file:

```
'monzo' => [
        'client_id' => env('MONZO_CLIENT_ID'),
        'client_secret' => env('MONZO_CLIENT_SECRET'),
        'redirect' => env('MONZO_REDIRECT_URI'),
    ],
```

You can create an application at .

Laravel integration
-------------------

[](#laravel-integration)

`Amelia\Monzo\MonzoServiceProvider::class` is registered automatically in Laravel 5.5.

A future version of this package will include automatic webhook handling per-user, and full automatic socialite integration.

The environment variables that control these will be:

- `MONZO_WEBHOOKS=true`
- `MONZO_SOCIALITE=true`

### Socialite integration

[](#socialite-integration)

To automatically add callbacks for socialite, this package provides an optional authentication system.

> **Caveat**This assumes you are adding existing users to an app on monzo. If you are not doing this, you'll need to set up your own routes to create/manage users based on API responses from socialite.

First, add the `MonzoCredentials` trait to your `Authenticatable` user model.

```
