PHPackages                             traimmu/mf-cloud-invoice - 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. traimmu/mf-cloud-invoice

ActiveLibrary[API Development](/categories/api)

traimmu/mf-cloud-invoice
========================

MFCloud Invoice API wrapper

v0.0.9(8y ago)86.5k5[1 issues](https://github.com/Traimmu/mf-cloud-invoice-php/issues)MITPHP

Since Oct 18Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Traimmu/mf-cloud-invoice-php)[ Packagist](https://packagist.org/packages/traimmu/mf-cloud-invoice)[ RSS](/packages/traimmu-mf-cloud-invoice/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (9)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/df4d09cc758b4bce7ef7a6bd86113cf09d2268351908b0bc632d1dc35d73e3cc/68747470733a2f2f706f7365722e707567782e6f72672f747261696d6d752f6d662d636c6f75642d696e766f6963652f762f737461626c65)](https://packagist.org/packages/traimmu/mf-cloud-invoice)[![Latest Unstable Version](https://camo.githubusercontent.com/92d2b1351e23fd48231f7aeb238772e08a4985a936740465c9863ac1a2338c2c/68747470733a2f2f706f7365722e707567782e6f72672f747261696d6d752f6d662d636c6f75642d696e766f6963652f762f756e737461626c65)](https://packagist.org/packages/traimmu/mf-cloud-invoice)[![License](https://camo.githubusercontent.com/3547fcee9f7c39cdbc0a7d34154479e7e4ea986d1f0af970c773818f63d16133/68747470733a2f2f706f7365722e707567782e6f72672f747261696d6d752f6d662d636c6f75642d696e766f6963652f6c6963656e7365)](https://packagist.org/packages/traimmu/mf-cloud-invoice)[![Monthly Downloads](https://camo.githubusercontent.com/cbee27927c953ea81c45902ffdbb7e3b1574cb8cbe218f45f4c5f251797d29e9/68747470733a2f2f706f7365722e707567782e6f72672f747261696d6d752f6d662d636c6f75642d696e766f6963652f642f6d6f6e74686c79)](https://packagist.org/packages/traimmu/mf-cloud-invoice)[![CircleCI](https://camo.githubusercontent.com/f37c02f16d13f1a57a9719cbd3764be9188bc3a95e1761dbbf3244b1268e423a/68747470733a2f2f636972636c6563692e636f6d2f67682f547261696d6d752f6d662d636c6f75642d696e766f6963652d7068702e7376673f7374796c653d737667)](https://circleci.com/gh/Traimmu/mf-cloud-invoice-php)

mf\_cloud-invoice-php
=====================

[](#mf_cloud-invoice-php)

[MFクラウド請求書API](https://github.com/moneyforward/invoice-api-doc) client library for PHP

This library is inspired by [moneyforward/mf\_cloud-invoice-ruby](https://github.com/moneyforward/mf_cloud-invoice-ruby)

Installation
============

[](#installation)

```
composer require traimmu/mf-cloud-invoice

```

Usage
=====

[](#usage)

Build client
------------

[](#build-client)

```
use Traimmu\MfCloud\Invoice\Client;

$client = new Client('YOUR_ACCESS_TOKEN');

$client->billings()->all();
// => your billings
```

Get My Office
-------------

[](#get-my-office)

```
$office = $client->office(); // => returns Traimmu\MfCloud\Invoice\Models\Office instance
echo $office->name; // => '株式会社Traimmu'

$office->update([
    'name' => 'section9',
    'zip' => '101-1111',
]);
echo $office->name; // => 'section9'
```

### Get Partners

[](#get-partners)

```
$client->partners()->all();
$client->partners()->find('MF INVOICE PARTNER ID');
```

### Get Billings

[](#get-billings)

```
$client->billings()->all();
```

### Items

[](#items)

```
$client->items()->all();
```

Laravel Integration
===================

[](#laravel-integration)

Add the `Traimmu\MfCloud\Invoice\Misc\ServiceProvider` provider to the `providers` array in `config/app.php`:

```
'providers' => [
    // ...
    Traimmu\MfCloud\Invoice\Misc\ServiceProvider::class,
],
```

Then add the facade to your `aliases` array:

```
'aliases' => [
    // ...
    'Invoice' => Traimmu\MfCloud\Invoice\Misc\Facade::class,
],
```

Finally, add the following lines at `config/services.php`:

```
// ...
'mfcloud' => [
    'secret' => env('MFCLOUD_INVOICE_API_TOKEN'),
],
```

Example
=======

[](#example)

Get partners which have more than one departments:

```
