blaaiz / blaaiz-laravel-sdk
Official Laravel SDK for Blaaiz RaaS (Remittance as a Service) API
v1.0.7
2026-04-06 20:21 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- laravel/pint: ^1.0
- mockery/mockery: ^1.5
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11.0
- dev-main
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-claude/fix-identity-back-parameter-uOCbR
- dev-add-new-apis
- dev-claude/laravel-sdk-content-type-RIjOE
- dev-dependabot/github_actions/actions/upload-artifact-7
- dev-dependabot/github_actions/actions/cache-5
- dev-dependabot/github_actions/actions/checkout-6
- dev-dependabot/github_actions/codecov/codecov-action-5
This package is auto-updated.
Last update: 2026-04-06 20:24:06 UTC
README
Official Laravel SDK for the Blaaiz RaaS (Remittance as a Service) API.
Installation
composer require blaaiz/blaaiz-laravel-sdk
Laravel package discovery is enabled automatically.
Quick Start
OAuth 2.0
OAuth is recommended for new integrations.
BLAAIZ_CLIENT_ID=your-client-id BLAAIZ_CLIENT_SECRET=your-client-secret BLAAIZ_API_URL=https://api-dev.blaaiz.com
use Blaaiz\LaravelSdk\Facades\Blaaiz; $isConnected = Blaaiz::testConnection(); $currencies = Blaaiz::currencies()->list();
Legacy API key
You can also authenticate with a legacy API key:
BLAAIZ_API_KEY=your-api-key BLAAIZ_API_URL=https://api-dev.blaaiz.com
use Blaaiz\LaravelSdk\Facades\Blaaiz; $isConnected = Blaaiz::testConnection(); $wallets = Blaaiz::wallets()->list();
When both OAuth credentials and an API key are configured, OAuth is used.
Publish configuration
php artisan vendor:publish --tag=blaaiz-config
Basic usage with dependency injection
use Blaaiz\LaravelSdk\Blaaiz; class RatesController { public function __invoke(Blaaiz $blaaiz) { return response()->json($blaaiz->rates()->list()); } }
Configuration
The published config file exposes these options:
return [ 'api_key' => env('BLAAIZ_API_KEY', ''), 'client_id' => env('BLAAIZ_CLIENT_ID', ''), 'client_secret' => env('BLAAIZ_CLIENT_SECRET', ''), 'oauth_scope' => env('BLAAIZ_OAUTH_SCOPE', ''), 'base_url' => env('BLAAIZ_API_URL', 'https://api-dev.blaaiz.com'), 'timeout' => env('BLAAIZ_TIMEOUT', 30), 'webhook_secret' => env('BLAAIZ_WEBHOOK_SECRET', ''), ];
Available Services
customers()collections()payouts()wallets()virtualBankAccounts()transactions()banks()currencies()fees()files()webhooks()rates()swaps()
These services are also exposed as public properties on the underlying SDK instance.
Common Examples
Create a customer
use Blaaiz\LaravelSdk\Facades\Blaaiz; $customer = Blaaiz::customers()->create([ 'first_name' => 'John', 'last_name' => 'Doe', 'type' => 'individual', 'email' => 'john.doe@example.com', 'country' => 'NG', 'id_type' => 'passport', 'id_number' => 'A12345678', ]);
Initiate a payout
$payout = Blaaiz::payouts()->initiate([ 'wallet_id' => 'wallet-id', 'customer_id' => 'customer-id', 'method' => 'bank_transfer', 'from_currency_id' => 'USD', 'to_currency_id' => 'NGN', 'from_amount' => 100, 'bank_id' => 'bank-id', 'account_number' => '0123456789', ]);
Upload a KYC document
$result = Blaaiz::customers()->uploadFileComplete('customer-id', [ 'file' => storage_path('app/private/passport.pdf'), 'file_category' => 'identity', ]);
Verify a webhook
$event = Blaaiz::webhooks()->constructEvent( $request->getContent(), $request->header('X-Blaaiz-Signature', ''), $request->header('X-Blaaiz-Timestamp', ''), config('blaaiz.webhook_secret') );
API Reference
- Root SDK helpers
- Customers
- Collections
- Payouts
- Wallets and virtual bank accounts
- Transactions, banks, currencies, and rates
- Fees and files
- Webhooks
- Swaps
Runnable Examples
See examples/README.md for Laravel-oriented example classes and snippets.
High-Level Helpers
The root SDK object includes:
testConnection()createCompletePayout(array $config)createCompleteCollection(array $config)
These helpers compose the lower-level services for common workflows.
Error Handling
use Blaaiz\LaravelSdk\Exceptions\BlaaizException; use Blaaiz\LaravelSdk\Facades\Blaaiz; try { $rates = Blaaiz::rates()->list(); } catch (BlaaizException $e) { report($e); return response()->json($e->toArray(), $e->getStatus() ?? 500); }
Development
composer test
composer analyse
composer format