1. Go to this page and download the library: Download itamelions/mono-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
itamelions / mono-php-sdk example snippets
use Mono\Mono;
$mono = new Mono($_ENV['MONO_SECRET_KEY']);
// Create a customer
$customer = $mono->customer()->create([
'email' => '[email protected]',
'first_name' => 'John',
'last_name' => 'Doe',
'phone' => '+2348000000000',
'identity' => ['type' => 'bvn', 'number' => '12345678901'],
]);
$customerId = $customer['data']['id'];
// Initiate a hosted mandate (returns a mono_url — redirect your user there)
$initiation = $mono->mandate()->initiate([
'amount' => 5000000, // amount in kobo (₦50,000)
'type' => 'recurring-debit',
'method' => 'mandate',
'mandate_type' => 'sweep',
'debit_type' => 'variable',
'reference' => 'your-unique-ref',
'redirect_url' => 'https://yourapp.com/mandate/callback',
'customer' => ['id' => $customerId],
'start_date' => '2026-01-01', // Mono interprets bare dates as midnight UTC
'end_date' => '2031-01-01',
]);
$monoUrl = $initiation['data']['mono_url'];
// → redirect the user to $monoUrl to complete mandate authorisation