Search by

inlomax / inlomax-php

nelsonitodo

The official PHP SDK for the Inlomax API

dev-main 2026-08-16 15:36 UTC

This package is auto-updated.

Last update: 2026-09-16 15:52:39 UTC


README

The official PHP SDK for the Inlomax API. This SDK makes it easy for developers to integrate Inlomax services like Airtime, Data, Cable TV, Electricity, Education Pins, and KYC verifications into their PHP applications.

Requirements

  • PHP >= 7.4
  • Composer

Installation

You can install the package via composer:

composer require inlomax/inlomax-php

(Note: Until published on Packagist, you can install it locally by configuring a local composer repository).

Usage

Initialization

Initialize the client with your API key. You can find your API key in your Inlomax developer dashboard.

require_once 'vendor/autoload.php';

use Inlomax\Inlomax\Client;

// Provide your API Key. Set the second parameter to true if you are using the sandbox environment.
$apiKey = 'YOUR_API_KEY';
$isSandbox = false;

$inlomax = new Client($apiKey, $isSandbox);

Get Wallet Balance

try {
    $response = $inlomax->getBalance();
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Buy Airtime

try {
    $payload = [
        "serviceID" => "100", // Check services endpoint for IDs
        "amount" => 200,
        "mobileNumber" => "0903837261",
        "request-id" => uniqid() // Ensure this is unique per transaction
    ];
    $response = $inlomax->buyAirtime($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Buy Data

try {
    $payload = [
        "serviceID" => "100",
        "mobileNumber" => "0903837261",
        "request-id" => uniqid()
    ];
    $response = $inlomax->buyData($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Pay for Electricity

try {
    $payload = [
        "serviceID" => "1",
        "amount" => 1000,
        "meterNumber" => "11111111111", // Example field, check API docs for exact fields required
        "request-id" => uniqid()
    ];
    $response = $inlomax->buyElectricity($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Pay for Cable TV

try {
    $payload = [
        "serviceID" => "2", // Check API docs for exact IDs
        "smartCardNumber" => "1234567890", // Example field, check API docs
        "request-id" => uniqid()
    ];
    $response = $inlomax->buyCable($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Buy Education Pins

try {
    $payload = [
        "serviceID" => "3", // Check API docs for exact IDs
        "quantity" => 1, // Example field, check API docs
        "request-id" => uniqid()
    ];
    $response = $inlomax->buyEducationPins($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Verify Meter Number

try {
    $payload = [
        "meterNumber" => "11111111111",
        "disco" => "ikeja", // Example disco, check API docs
        "meterType" => "prepaid"
    ];
    $response = $inlomax->verifyMeter($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Verify Cable IUC

try {
    $payload = [
        "smartCardNumber" => "1234567890",
        "provider" => "dstv" // Example provider, check API docs
    ];
    $response = $inlomax->verifyIuc($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Get Services

try {
    $response = $inlomax->getServices();
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Verify Bank Account

try {
    $payload = [
        "accountNumber" => "0123456789",
        "bankCode" => "033" // Check API docs for bank codes
    ];
    $response = $inlomax->verifyBankAccount($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Verify BVN

try {
    $payload = [
        "bvn" => "12345678901"
    ];
    $response = $inlomax->verifyBvn($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Verify NIN

try {
    $payload = [
        "nin" => "12345678901"
    ];
    $response = $inlomax->verifyNin($payload);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Get Transaction

try {
    $reference = "your_transaction_reference";
    $response = $inlomax->getTransaction($reference);
    print_r($response);
} catch (\Inlomax\Inlomax\Exceptions\InlomaxException $e) {
    echo "Error: " . $e->getMessage();
}

Available Methods

  • getBalance()
  • getServices()
  • buyAirtime(array $payload)
  • buyData(array $payload)
  • buyCable(array $payload)
  • buyElectricity(array $payload)
  • buyEducationPins(array $payload)
  • verifyBankAccount(array $payload)
  • verifyBvn(array $payload)
  • verifyNin(array $payload)
  • verifyIuc(array $payload)
  • verifyMeter(array $payload)
  • getTransaction(string $reference)

Support

For any difficulty integrating the API, please refer to the official documentation or contact support.

License

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