Initiate an account balance request by making a HTTP GET request to the following endpoint:
https://api.statum.co.ke/api/v2/account-balance
Check your account balance by making a HTTP GET request to the endpoint above.
In addition to the API standard request headers , the body of the request should contain the following fields:
Parameter | Type | Description | Example |
---|---|---|---|
command_id | String | Pass this as balance | balance |
Sample account balance API call
<?php // credentials from your developer account $consumerKey = "568473daf6614cb196caeb5f8805985f"; $consumerSecret = "5a07f41de16e40e4b08b4001142a5a10"; $auth = base64_encode($consumerKey . ":" . $consumerSecret); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.statum.co.ke/api/v2/account-balance', CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_POSTFIELDS =>'{ "command_id": "balance" }', CURLOPT_HTTPHEADER => array( "Authorization: Basic $auth", "Content-Type: application/json" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
The body of the response will be a JSON object containing the following fields:
Parameter | Type | Description | Example |
---|---|---|---|
status_code | Number | The status code of the transaction. | 200 |
description | String | The status description of the transaction. | Operation successful |
request_id | String | The unique reference number as assigned by the Statum API | 87e6ede99a0d4201b0d7ee347e5b2788 |
available_balance | Decimal number | Your Statum developer application account balance. | 10001.45 |
Sample response payload
{ "status_code": 200, "description": "Operation successful.", "request_id": "87e6ede99a0d4201b0d7ee347e5b2788", "available_balance": 10001.45 }