Statum Company Logo

Getting Started with M-Pesa APIs, Airtime APIs, USSD APIs, and SMS APIs.

Welcome to the Statum Developer Hub! This guide will walk you through creating an account, obtaining your API credentials, and getting started with Statum's Communication and Payments APIs. Whether you're connecting to our interface for the first time or looking to test your integrations, our step-by-step instructions will help you get up and running quickly.

Accessing the Statum Developer Hub is easy. Simply register by providing your name, email, organization, and a secure password. Once you've verified your email address, you're ready to start developing your first API project.

Once logged in, you'll be directed to your dashboard—the central hub for creating and managing your API projects.

Let’s dive into the essential information you need to begin your API integration. We look forward to seeing what you build using our powerful solutions.

Statum API Integration Flow

The diagram below outlines the typical flow of an API request, showing how your application sends requests to the service provider via our gateway, and how we deliver responses back to your designated callback URL.

API Integration Flow - Statum

All API requests and responses, including error messages, are formatted in JSON. For a detailed understanding of our error handling and response standards, review the API response status codes, which comply with HTTP standards (RFC 2616).

This guide includes sample code snippets and JSON responses to help you quickly implement Statum's APIs into your applications, making integration seamless and efficient.

API Request Headers

To authenticate with the API, you need to include the following standard request headers:

Parameter Type Description Example
Authorization String Base64 encoded consumerKey:consumerSecret in an HTTP Authorization: Basic header Basic MmJlOTg5NzAzZDZkZTRhZTFiZWU2ODUzNWE1ZDQ4ZWJkOjNQMFI0cT
Content-Type String Request content type application/json
Accept String Response content type (Optional) application/json

Sample Request Headers

'Authorization: Basic MmJlOTg5NzAzZDZkZTRhZTFiZWU2ODUzNWE1ZDQ4ZWJkOjNQMFI0cT',
'Content-Type: application/json',
'Accept: application/json',

API Requests

Along with the API standard request headers, ensure the body contains the required fields and is formatted in JSON.

Send all API requests to https://api.statum.co.ke/api/v2/{command}, where {command} is the API call, and parameters are included in the request body (POST) or URL (GET).

Sample SMS API Request

{
  "sender_id": "Statum",
  "phone_number": "254712345678",
  "message": "This is a test Message through our API"
}

API Responses

After every API call, a JSON response is returned. The response includes key details such as status_code, description, and request_id.

A status code of 200 indicates a successful request, while any 400 or 500 series status code represents errors. Check the status codes to troubleshoot your API requests.

If an error occurs, the response will include both an error status code and a description.

Sample Successful API Response

{
  "status_code": 200,
  "description": "Operation successful",
  "request_id": "9V7NcW1QMvWkQcceMnn3MKfmczdBeE1a"
}

API Notifications and Results

When an event occurs, such as a message delivery or successful payment, Statum sends an API result notification to your callback URL with relevant transaction details.

Each notification contains a result code, such as 200 for success, and a corresponding result description.

Sample API Result Notification

{
  "result_code": "200",
  "result_desc": "Success",
  "request_id": "9V7NcW1QMvWkQcceMnn3MKfmczdBeE1a"
}
Statum. All rights reserved. © 2017 - 2024