blaaiz/blaaiz-php-sdk

Official framework-agnostic PHP SDK for the Blaaiz RaaS (Remittance as a Service) API

Maintainers

Package info

github.com/gbxnga/blaaiz-php-sdk

Homepage

Issues

pkg:composer/blaaiz/blaaiz-php-sdk

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.7 2026-04-06 20:19 UTC

This package is auto-updated.

Last update: 2026-04-06 20:22:03 UTC


README

Framework-agnostic PHP SDK for the Blaaiz RaaS (Remittance as a Service) API.

Installation

composer require blaaiz/blaaiz-php-sdk

Quick Start

OAuth 2.0

<?php

require __DIR__ . '/vendor/autoload.php';

use Blaaiz\PhpSdk\Blaaiz;

$blaaiz = new Blaaiz([
    'client_id' => 'your-client-id',
    'client_secret' => 'your-client-secret',
    'base_url' => 'https://api-dev.blaaiz.com',
]);

$currencies = $blaaiz->currencies()->list();

Legacy API key

<?php

require __DIR__ . '/vendor/autoload.php';

use Blaaiz\PhpSdk\Blaaiz;

$blaaiz = new Blaaiz([
    'api_key' => 'your-api-key',
    'base_url' => 'https://api-dev.blaaiz.com',
]);

$wallets = $blaaiz->wallets()->list();

When both OAuth credentials and an API key are provided, OAuth is used.

Configuration

The SDK constructor accepts:

[
    'api_key' => '...',
    'client_id' => '...',
    'client_secret' => '...',
    'oauth_scope' => 'wallet:read currency:read ...',
    'base_url' => 'https://api-dev.blaaiz.com',
    'timeout' => 30,
]

Available Services

  • customers()
  • collections()
  • payouts()
  • wallets()
  • virtualBankAccounts()
  • transactions()
  • banks()
  • currencies()
  • fees()
  • files()
  • webhooks()
  • rates()
  • swaps()

These services are also exposed as public properties, for example $blaaiz->customers.

Common Examples

Create a customer

$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' => __DIR__ . '/passport.pdf',
    'file_category' => 'identity',
]);

Verify a webhook

$event = $blaaiz->webhooks()->constructEvent(
    file_get_contents('php://input'),
    $_SERVER['HTTP_X_BLAAIZ_SIGNATURE'] ?? '',
    $_SERVER['HTTP_X_BLAAIZ_TIMESTAMP'] ?? '',
    'your-webhook-secret'
);

API Reference

Runnable Examples

See examples/README.md for runnable sample scripts.

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\PhpSdk\Exceptions\BlaaizException;

try {
    $blaaiz->currencies()->list();
} catch (BlaaizException $e) {
    var_dump($e->toArray());
}

Development

composer install
composer test
composer analyse