AfriRoute Payments Platform
Accept Payments Across Africa with One API
Process mobile money payments, send payouts, manage billing, and handle invoicing with AfriRoute's unified payments platform.
π― What is AfriRoute Payments?β
AfriRoute Payments enables businesses to:
- Accept Mobile Money - Telebirr, M-Pesa, MTN MoMo, Airtel Money, Orange Money
- Send Payouts - Disburse funds to merchants, gig workers, suppliers
- Usage Billing - Track API usage and generate invoices automatically
- Wallet System - Pre-funded wallets with real-time balance tracking
- Fraud Prevention - AI-powered fraud detection and risk scoring
π³ Supported Payment Methodsβ
| Provider | Countries | Type |
|---|---|---|
| Telebirr | Ethiopia | Mobile Money |
| M-Pesa | Kenya, Tanzania | Mobile Money |
| MTN Mobile Money | Ghana, Nigeria, Uganda, Rwanda, Zambia | Mobile Money |
| Airtel Money | Kenya, Tanzania, Uganda, Zambia | Mobile Money |
| Orange Money | CΓ΄te d'Ivoire, Senegal, Mali | Mobile Money |
| Visa/Mastercard | Pan-Africa | Card Payment |
π Quick Startβ
Accept a Mobile Money Paymentβ
Node.js - Initiate Payment
const axios = require('axios');
const payment = await axios.post('https://api.afriroute.ai/api/v1/payments/mobile/initiate', {
amount: 500,
currency: 'ETB',
phone_number: '+251911234567',
provider: 'telebirr',
description: 'Order #12345 payment',
customer_email: '[email protected]',
callback_url: 'https://yourapp.com/payment/callback',
metadata: {
order_id: '12345',
customer_id: 'CUST_789'
}
}, {
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
});
console.log(payment.data);
// Response:
// {
// "payment_id": "pay_abc123xyz",
// "status": "pending",
// "amount": 500,
// "currency": "ETB",
// "provider": "telebirr",
// "created_at": "2025-12-10T14:30:00Z",
// "expires_at": "2025-12-10T14:35:00Z"
// }
Python - Initiate Payment
import requests
response = requests.post('https://api.afriroute.ai/api/v1/payments/mobile/initiate',
json={
'amount': 500,
'currency': 'ETB',
'phone_number': '+251911234567',
'provider': 'telebirr',
'description': 'Order #12345 payment',
'customer_email': '[email protected]',
'callback_url': 'https://yourapp.com/payment/callback',
'metadata': {
'order_id': '12345',
'customer_id': 'CUST_789'
}
},
headers={'Authorization': 'Bearer $AFRIROUTE_API_KEY'}
)
print(response.json())
C# - Initiate Payment
using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer $AFRIROUTE_API_KEY");
var payload = new
{
amount = 500,
currency = "ETB",
phone_number = "+251911234567",
provider = "telebirr",
description = "Order #12345 payment",
customer_email = "[email protected]",
callback_url = "https://yourapp.com/payment/callback",
metadata = new { order_id = "12345", customer_id = "CUST_789" }
};
var content = new StringContent(
JsonSerializer.Serialize(payload),
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync(
"https://api.afriroute.ai/api/v1/payments/mobile/initiate",
content
);
Go - Initiate Payment
package main
import (
"bytes"
"encoding/json"
"net/http"
)
type Payment struct {
Amount int `json:"amount"`
Currency string `json:"currency"`
PhoneNumber string `json:"phone_number"`
Provider string `json:"provider"`
Description string `json:"description"`
CustomerEmail string `json:"customer_email"`
CallbackURL string `json:"callback_url"`
Metadata map[string]interface{} `json:"metadata"`
}
func main() {
payment := Payment{
Amount: 500,
Currency: "ETB",
PhoneNumber: "+251911234567",
Provider: "telebirr",
Description: "Order #12345 payment",
CustomerEmail: "[email protected]",
CallbackURL: "https://yourapp.com/payment/callback",
Metadata: map[string]interface{}{
"order_id": "12345",
"customer_id": "CUST_789",
},
}
jsonData, _ := json.Marshal(payment)
req, _ := http.NewRequest("POST", "https://api.afriroute.ai/api/v1/payments/mobile/initiate", bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer $AFRIROUTE_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}
Check Payment Statusβ
Get Payment Status
const status = await axios.get(
'https://api.afriroute.ai/api/v1/payments/mobile/pay_abc123xyz',
{
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
}
);
console.log(status.data);
// Response:
// {
// "payment_id": "pay_abc123xyz",
// "status": "completed",
// "amount": 500,
// "currency": "ETB",
// "provider": "telebirr",
// "provider_reference": "TXN123456789",
// "completed_at": "2025-12-10T14:31:23Z",
// "customer": {
// "phone": "+251911234567",
// "email": "[email protected]"
// }
// }
Payment Statuses:
pending- Awaiting customer approvalprocessing- Payment being processedcompleted- Payment successfulfailed- Payment declined/failedcancelled- Payment cancelledexpired- Payment link expired
Handle Payment Webhooksβ
AfriRoute sends webhooks for all payment events:
Webhook Handler (Express.js)
const express = require('express');
const crypto = require('crypto');
const app = express();
app.use(express.json());
app.post('/payment/callback', (req, res) => {
// Verify webhook signature
const signature = req.headers['x-afriroute-signature'];
const payload = JSON.stringify(req.body);
const secret = 'your_webhook_secret';
const hash = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
if (hash !== signature) {
return res.status(401).send('Invalid signature');
}
// Process payment event
const { event, data } = req.body;
if (event === 'payment.completed') {
console.log(`Payment ${data.payment_id} completed!`);
// Update order status
// Send confirmation email
// Release product/service
} else if (event === 'payment.failed') {
console.log(`Payment ${data.payment_id} failed: ${data.failure_reason}`);
// Notify customer
// Log failure
}
res.status(200).send('OK');
});
app.listen(3000);
πΈ Payouts (Disbursements)β
Send money to merchants, gig workers, or suppliers:
Send Payout
const payout = await axios.post('https://api.afriroute.ai/api/v1/payments/payout', {
amount: 1000,
currency: 'ETB',
phone_number: '+251911234567',
provider: 'telebirr',
reason: 'Gig payment for delivery #45678',
reference: 'PAYOUT_45678',
metadata: {
driver_id: 'DRV_123',
delivery_id: '45678'
}
}, {
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
});
// Response
{
"payout_id": "out_xyz789",
"status": "processing",
"amount": 1000,
"currency": "ETB",
"recipient": "+251911234567",
"estimated_arrival": "2025-12-10T15:00:00Z"
}
Payout Use Cases:
- Gig worker payments
- Merchant disbursements
- Refunds
- Salaries
- Commissions
- Supplier payments
Bulk Payoutsβ
Process multiple payouts in one request:
Bulk Payouts
const bulkPayout = await axios.post('https://api.afriroute.ai/api/v1/payments/payout/bulk', {
payouts: [
{
amount: 500,
currency: 'ETB',
phone_number: '+251911111111',
provider: 'telebirr',
reference: 'DRIVER_001'
},
{
amount: 750,
currency: 'ETB',
phone_number: '+251922222222',
provider: 'telebirr',
reference: 'DRIVER_002'
},
{
amount: 600,
currency: 'ETB',
phone_number: '+251933333333',
provider: 'telebirr',
reference: 'DRIVER_003'
}
],
description: 'Weekly driver payouts'
}, {
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
});
// Response
{
"batch_id": "batch_abc123",
"total_payouts": 3,
"total_amount": 1850,
"currency": "ETB",
"status": "processing",
"payouts": [
{ "payout_id": "out_001", "status": "pending" },
{ "payout_id": "out_002", "status": "pending" },
{ "payout_id": "out_003", "status": "pending" }
]
}
π° Wallet Systemβ
AfriRoute uses a pre-funded wallet system:
Check Wallet Balance
const balance = await axios.get(
'https://api.afriroute.ai/api/v1/wallet/balance',
{
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
}
);
// Response
{
"balance": 15000.00,
"currency": "ETB",
"last_topup": "2025-12-01T10:00:00Z",
"monthly_spend": 5400.00,
"low_balance_alert": 5000.00
}
Top-up Wallet
const topup = await axios.post('https://api.afriroute.ai/api/v1/wallet/topup', {
amount: 10000,
currency: 'ETB',
payment_method: 'bank_transfer',
reference: 'TXN_BANK_123'
}, {
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
});
Wallet Features:
- Real-time balance tracking
- Auto-recharge (optional)
- Low balance alerts
- Transaction history
- Multi-currency support
π Transaction Historyβ
Get Transactions
const transactions = await axios.get(
'https://api.afriroute.ai/api/v1/payments/transactions',
{
params: {
start_date: '2025-12-01',
end_date: '2025-12-10',
status: 'completed',
limit: 50
},
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
}
);
// Response
{
"total": 234,
"page": 1,
"per_page": 50,
"transactions": [
{
"transaction_id": "txn_001",
"type": "payment",
"amount": 500,
"currency": "ETB",
"status": "completed",
"provider": "telebirr",
"created_at": "2025-12-10T14:30:00Z"
}
]
}
π‘οΈ Fraud Preventionβ
AfriRoute includes built-in fraud detection:
Get Risk Score
const risk = await axios.post('https://api.afriroute.ai/api/v1/payments/risk-check', {
phone_number: '+251911234567',
amount: 5000,
currency: 'ETB'
}, {
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
});
// Response
{
"risk_score": 23, // 0-100 (lower is better)
"risk_level": "low",
"factors": [
"New customer",
"High amount for first transaction"
],
"recommendation": "proceed_with_verification",
"checks": {
"phone_verified": true,
"device_fingerprint": "known",
"velocity_check": "passed",
"blacklist_check": "passed"
}
}
Fraud Prevention Features:
- Real-time risk scoring
- Device fingerprinting
- Velocity checks
- Blacklist screening
- Geolocation analysis
- Behavioral analysis
π Billing & Invoicingβ
Automatic billing for API usage:
Generate Invoice
const invoice = await axios.post('https://api.afriroute.ai/api/v1/billing/invoice/generate', {
period_start: '2025-12-01',
period_end: '2025-12-31'
}, {
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
});
// Response
{
"invoice_id": "inv_dec_2025",
"period": "December 2025",
"line_items": [
{
"description": "SMS Messages",
"quantity": 10000,
"unit_price": 0.05,
"total": 500.00
},
{
"description": "Voice Minutes",
"quantity": 450,
"unit_price": 0.02,
"total": 9.00
},
{
"description": "Payment Processing",
"quantity": 150,
"unit_price": 0.5,
"total": 75.00
}
],
"subtotal": 584.00,
"tax": 0,
"total": 584.00,
"currency": "ETB",
"due_date": "2026-01-15",
"pdf_url": "https://invoices.afriroute.ai/inv_dec_2025.pdf"
}
π² Pricingβ
Payment Processing Feesβ
| Provider | Fee | Example |
|---|---|---|
| Telebirr | 2.5% | 500 ETB β 12.5 ETB fee |
| M-Pesa | 2.5% | 1000 KES β 25 KES fee |
| MTN MoMo | 2.5% | 100 GHS β 2.5 GHS fee |
| Airtel Money | 2.5% | 1000 UGX β 25 UGX fee |
Payout Feesβ
| Region | Fee | Example |
|---|---|---|
| Ethiopia | 1.5% | 1000 ETB β 15 ETB fee |
| Kenya | 1.5% | 2000 KES β 30 KES fee |
| Nigeria | 1.5% | 5000 NGN β 75 NGN fee |
π Coverageβ
Countries with Mobile Money:
| Country | Providers |
|---|---|
| Ethiopia | Telebirr, M-Birr |
| Kenya | M-Pesa, Airtel Money |
| Tanzania | M-Pesa, Tigo Pesa, Airtel Money |
| Uganda | MTN Mobile Money, Airtel Money |
| Rwanda | MTN Mobile Money, Airtel Money |
| Ghana | MTN Mobile Money, AirtelTigo Money |
| Nigeria | MTN MoMo (coming soon) |
π Next Stepsβ
- Mobile Money Integration - Setup payments
- Payouts Guide - Send disbursements
- Wallet Management - Manage your balance
- API Reference - View all endpoints
- Tutorial - Complete integration guide
π Need Help?β
- API Reference: View payment endpoints
- Tutorial: Payment integration guide
- Support: [email protected]
- Sales: [email protected]
Ready to start accepting payments? Get API keys β