Download the PHP package statum/statum-php-sdk without Composer
On this page you can find all versions of the php package statum/statum-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package statum-php-sdk
Statum PHP SDK (SMS, Airtime, & Accounts)
Official PHP SDK for Statum APIs. Built for secure, production-grade enterprise usage with strict typing, immutable DTOs, and framework-agnostic Guzzle HTTP integrations. Easily send SMS alerts, automate airtime disbursements, and query real-time account balances.
Table of Contents
- Features
- Getting Started
- Installation
- Quick Start in 2 Minutes
- 1. Plain PHP Setup
- 2. Laravel Setup
- Core Integration Examples
- Account Details
- Sending SMS
- Disbursing Airtime
- Error & Exception Handling
- API JSON Payload Specifications
- Integration Guidelines & Gotchas
- Running Tests
- License
Features
- Type-Safe Constructors: Parameter validation happens locally inside the SDK before outgoing HTTP calls.
- Service-Oriented Design: Clean division between SMS, Airtime, and Account APIs.
- Framework Agnostic: Works out of the box in plain scripts, Symfony, or Laravel.
- Extensive Exception Handling: Maps specific HTTP status codes (e.g. 401, 402, 422) to concrete PHP exception classes.
- Strict Typing: Full compatibility with PHP 8.1+ strict mode.
Getting Started
- Sign up for a Statum account: app.statum.co.ke
- Get your API credentials: Retrieve your Consumer Key and Consumer Secret from the Statum Dashboard.
- Read the full API documentation: docs.statum.co.ke
- Install the SDK: Follow the Installation guidelines below.
Installation
Install the package via Composer:
Quick Start in 2 Minutes
Ensure your credentials are saved in your .env or system environment:
1. Plain PHP Setup
2. Laravel Setup
The SDK supports package auto-discovery in Laravel. To configure it, publish the configuration file:
This will create a config/statum.php file. You can configure your credentials via your .env file:
Now type-hint StatumClient in any controller or job to inject the initialized client:
Core Integration Examples
Account Details
Fetch organization profile, available balances, and service configuration:
Sending SMS
Send transactional or promotional SMS alerts to a recipient phone number:
Disbursing Airtime
Disburse airtime rewards or incentives (supports amounts from KES 5 to KES 10,000):
Error & Exception Handling
The SDK maps HTTP responses to concrete exception classes that inherit from Statum\Sdk\Exceptions\ApiException.
API JSON Payload Specifications
Here are the wire-level JSON schemas transmitted and returned by the APIs under the hood:
1. SMS API
- Endpoint:
POST /sms - Headers:
Authorization: Basic <base64(key:secret)>
JSON Request
JSON Response (Success - 200)
2. Airtime API
- Endpoint:
POST /airtime
JSON Request
JSON Response (Success - 200)
3. Account Details API
- Endpoint:
GET /account-details
JSON Response (Success - 200)
Integration Guidelines & Gotchas
- Sender ID Approval: SMS requests will throw an HTTP 422
ValidationExceptionif thesenderIdis not registered and approved under your Statum account profile. - Phone Number Formatting: Ensure phone numbers are passed in the international format (with or without
+prefix), e.g.254721553678or+254721553678. - Airtime Limits: Airtime amounts must be passed as strings (e.g.
'100') and must fall strictly within the KES 5 to KES 10,000 range per transaction.
Running Tests
Ensure PHPUnit is configured and run:
License
This project is licensed under the MIT License. See LICENSE for details.