Клієнт monobank API для Laravel: особиста інформація, виписки, курси валют і обробка вебхуків. Типізований REST-клієнт із підтримкою Laravel 10-13.
README
Monobank API client for PHP
A lightweight and expressive PHP wrapper for the Monobank API. It provides simple methods for accessing public banking information and personal account data.
Installation
You can install the package via composer:
composer require sashalenz/monobank-api
You can publish the config file with:
php artisan vendor:publish --tag="monobank-api-config"
This is the contents of the published config file:
return [
];
Usage
This package provides helpers for all Monobank API requests:
MonobankApi::bank()->currency()– get current currency exchange rates.MonobankApi::personal()->clientInfo()– retrieve information about accounts and cards.MonobankApi::personal()->webhook($url)– register a webhook URL for transaction updates.MonobankApi::personal()->statement($account, $dateFrom, $dateTo = null)– fetch a statement for a specific account and period.
Examples
Currency rates
Retrieve public exchange rates without authentication.
use Sashalenz\MonobankApi\MonobankApi;
$rates = MonobankApi::bank()->currency();
foreach ($rates as $rate) {
echo $rate->currencyCodeA . ' => ' . $rate->rateBuy . PHP_EOL;
}
Client information
Get information about your accounts and cards.
$info = MonobankApi::personal()->token($token)->clientInfo();
Register webhook
Configure a webhook to receive transaction updates.
MonobankApi::personal()->token($token)->webhook('https://example.com/monobank');
Webhook route configuration
The package registers two inbound webhook routes (POST {prefix}/{webhook_key} and
POST {prefix}/{acquiring_webhook_key}). Where and how they mount is fully
configurable (Livewire-style) — set these in config/monobank-api.php or via env:
| Config / env | Default | Purpose |
|---|---|---|
webhook_routes_enabled / MONOBANK_WEBHOOK_ROUTES_ENABLED |
true |
Set false to skip route registration entirely (e.g. when you handle the webhook elsewhere). |
webhook_domain / MONOBANK_WEBHOOK_DOMAIN |
null (any host) |
Constrain the routes to a domain. |
webhook_prefix / MONOBANK_WEBHOOK_PREFIX |
monobank-api |
URL path prefix. |
webhook_middleware / MONOBANK_WEBHOOK_MIDDLEWARE |
[] |
Middleware/guards (env = comma-separated list). |
webhook_key / acquiring_webhook_key |
webhook / acquiring-webhook |
Path segment per controller. |
All defaults preserve the previous behaviour.
Account statement
Fetch the statement for an account within a given period.
$statement = MonobankApi::personal()
->token($token)
->statement($accountId, $dateFrom, $dateTo);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Схожі пакети
SendPulse REST API
Офіційний PHP SDK для SendPulse: email-розсилки, SMS, web-push, чат-боти та транзакційна пошта. Сервіс заснований в Україні і виріс у міжнародну платформу, тож SDK підтримується активно і має найбільшу аудиторію в добірці.
NovaPoshta for Laravel
Обгортка над API 2.0 Нової Пошти для Laravel: адреси, відділення, вантажі, документи та відстеження посилок. Один із найпоширеніших пакетів для інтеграції з Новою Поштою в українських проєктах.
TurboSMS for Laravel
Пакет для роботи з TurboSMS у Laravel: надсилання SMS і Viber, перевірка балансу та статусів доставки. Один із найпоширеніших SMS-пакетів в українських Laravel-проєктах.
- Версія
- 2.1.0
- Laravel
- 13
- Завантажень
- 460
- Реліз
- 13 червня 2026
- Походження
- Українська розробка
- Категорія
- Українські сервіси