Across Africa API Documentation
Collect local and cross-border Mobile Money collections directly into your multi-currency ledger balance seamlessly using the centralized gateway framework of OptimaPay Bridge.
🌍 Enterprise Regional Settlement Core
The processing module automatically tracks multi-currency balances—including local wallet entries (such as KES, UGX, TZS, ZMW, RWF, and BIF) handled inside secure transaction settlement matrix lines.
📊 Processing & Settlement Rules
All API cross-border transactions are subject to a static 5% gateway processing fee. Settled funds are locked upon confirmation and automatically mature into your withdrawable balances at 11:00 AM local time the next day.
Secure Authentication Handshake
Production endpoints are authorized using custom static HTTP headers. Keep these credentials safely defined in secure environment parameters exclusively.
| Header Key | Verification Assignment Scope |
|---|---|
| X-API-KEY | Your unique developer identity code found in the OptimaPay settings layout. |
| X-API-SECRET | Your private master integration signature string. Never expose this on public client files. |
Supported Core Destination Markets
Outbound phone numbers passed within validation frames must match the corresponding international terminal dial tags below:
| Country Market | Currency Token | Dial Prefix | Expected Standard Numerical String Target |
|---|---|---|---|
| Kenya | KES | 254 | 254712345678 |
| Uganda | UGX | 256 | 256700000000 |
| Tanzania | TZS | 255 | 255600000000 |
| Rwanda | RWF | 250 | 250700000000 |
| Burundi | BIF | 257 | 257700000000 |
| Zambia | ZMW | 260 | 260700000000 |
| South Africa | ZAR | 27 | 277000000000 |
| Nigeria | NGN | 234 | 234700000000 |
| Ghana | GHS | 233 | 233700000000 |
Payment Initialization Endpoint
Send a structured POST payment request array to launch a hosted customer gateway interface session.
https://optimapaybridge.co.ke/api/v2/initiate_jipay.php
| Parameter | Data Type | Required | Field Core Requirements |
|---|---|---|---|
amount | Float | Yes | Total local money format to trigger. Value must remain > 0. |
currency | String | Yes | The 3-letter target asset code mapping (e.g., KES, UGX, TZS). |
phone | String | Yes | Target customer line including standard dialing prefixes. |
order_id | String | No | Your unique merchant side internal tracking key reference. |
callback_url | String | No | The absolute return link where customers are redirected after completing checkout. If empty, defaults back to the bridge framework interface. |
Multi-Language Copyable Code Examples
Select your operational runtime environment below to copy production code samples immediately:
<?php
// 1. Map Gateway endpoint coordinates
$apiUrl = "https://optimapaybridge.co.ke/api/v2/initiate_jipay.php";
$apiKey = "YOUR_OPTIMAPAY_KEY";
$apiSecret = "YOUR_OPTIMAPAY_SECRET";
$payload = [
"amount" => 3500,
"currency" => "UGX",
"phone" => "256700000000",
"order_id" => "ORDER-TX-99021",
"callback_url" => "https://yourmerchantwebsite.com/checkout/success"
];
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-API-KEY: " . $apiKey,
"X-API-SECRET: " . $apiSecret,
"Content-Type: application/json"
]
]);
$responseString = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$res = json_decode($responseString, true);
if ($httpCode === 200 && isset($res['success']) && $res['success'] === true) {
header("Location: " . $res['redirect_url']);
exit;
} else {
echo "OptimaPay Error: " . ($res['message'] ?? 'Connection error');
}
?>
const axios = require('axios');
const payload = {
amount: 1200,
currency: 'KES',
phone: '254712345678',
order_id: 'ORDER-NX-88301',
callback_url: 'https://yourmerchantwebsite.com/checkout/success'
};
axios.post('https://optimapaybridge.co.ke/api/v2/initiate_jipay.php', payload, {
headers: {
'X-API-KEY': 'YOUR_OPTIMAPAY_KEY',
'X-API-SECRET': 'YOUR_OPTIMAPAY_SECRET',
'Content-Type': 'application/json'
}
})
.then(response => {
if (response.data.success) {
console.log("Redirect Target:", response.data.redirect_url);
}
})
.catch(error => {
console.error("API Error Trace:", error.message);
});
import requests
api_url = "https://optimapaybridge.co.ke/api/v2/initiate_jipay.php"
headers = {
"X-API-KEY": "YOUR_OPTIMAPAY_KEY",
"X-API-SECRET": "YOUR_OPTIMAPAY_SECRET",
"Content-Type": "application/json"
}
payload = {
"amount": 450.00,
"currency": "ZMW",
"phone": "260700000000",
"order_id": "ORDER-PY-44021",
"callback_url": "https://yourmerchantwebsite.com/checkout/success"
}
response = requests.post(api_url, json=payload, headers=headers)
if response.status_code == 200:
data = response.json()
print(f"Redirecting client session to: {data.get('redirect_url')}")
Instant Payment Webhooks
Once a user authorizes payment confirmation on their handset, our infrastructure fires an automated async server webhook notification body to your stored listener endpoint link.
{
"event": "payment.completed",
"reference": "jp_65ef9a2c31ab",
"transaction_id": "TXN_4000E27C6509",
"status": "successful",
"data": {
"reference": "jp_65ef9a2c31ab",
"transaction_id": "TXN_4000E27C6509",
"status": "successful",
"metadata": {
"order_id": "ORDER-TX-99021"
}
}
}