An open API service indexing awesome lists of open source software.

https://github.com/khandurdyiev/monobank-php-client

PHP Client for Monobank API
https://github.com/khandurdyiev/monobank-php-client

monobank monobank-api monobank-php-client php php-client

Last synced: about 1 month ago
JSON representation

PHP Client for Monobank API

Awesome Lists containing this project

README

          

# Monobank PHP Client

Total Downloads
Latest Stable Version
License
PHP Version

Monobank php client helps you to use [Monobank API](https://api.monobank.ua/docs/) easily.

## Installation

It's recommended that you use [Composer](https://getcomposer.org/) to install Monobank php client.

```bash
$ composer require khandurdyiev/monobank-php-client
```

## Important
*All money amounts in dime (according to Monobank API)*

## Basic Usage (Public Data)
```php
currency()->all();

foreach ($currencies as $currency) {
$currencyA = $currency->getCurrencyA(); // USD
$currencyB = $currency->getCurrencyB(); // UAH
$date = $currency->getDate(); // returns Carbon instance with date
// ...
}
```

## Usage with token (Private Data)

```php
clientInfo();
$name = $clientInfo->getName();
$accounts = $clientInfo->getAccounts()->all();

foreach ($accounts as $account) {
$balance = $account->getBalance(); // 123456
$creditLimit = $account->getCreditLimit(); // 654321
$currency = $account->getCurrency(); // UAH

// ...
}

// Get statements of concrete account
$from = Carbon::now()->subMonth();
$to = Carbon::now();
$statements = $mono->statements($from, $to, 'account_id')->all();

foreach ($statements as $statement) {
$amount = $statement->getAmount(); // 123456
$cashbackAmount = $statement->getCashbackAmount(); // 123456
$currency = $statement->getCurrency(); // UAH
// ...
}
```

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.