Skip to main content

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​

ProviderCountriesType
TelebirrEthiopiaMobile Money
M-PesaKenya, TanzaniaMobile Money
MTN Mobile MoneyGhana, Nigeria, Uganda, Rwanda, ZambiaMobile Money
Airtel MoneyKenya, Tanzania, Uganda, ZambiaMobile Money
Orange MoneyCΓ΄te d'Ivoire, Senegal, MaliMobile Money
Visa/MastercardPan-AfricaCard Payment

View complete coverage β†’

πŸš€ 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 approval
  • processing - Payment being processed
  • completed - Payment successful
  • failed - Payment declined/failed
  • cancelled - Payment cancelled
  • expired - 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​

ProviderFeeExample
Telebirr2.5%500 ETB β†’ 12.5 ETB fee
M-Pesa2.5%1000 KES β†’ 25 KES fee
MTN MoMo2.5%100 GHS β†’ 2.5 GHS fee
Airtel Money2.5%1000 UGX β†’ 25 UGX fee

Payout Fees​

RegionFeeExample
Ethiopia1.5%1000 ETB β†’ 15 ETB fee
Kenya1.5%2000 KES β†’ 30 KES fee
Nigeria1.5%5000 NGN β†’ 75 NGN fee

View complete pricing β†’

🌍 Coverage​

Countries with Mobile Money:

CountryProviders
EthiopiaTelebirr, M-Birr
KenyaM-Pesa, Airtel Money
TanzaniaM-Pesa, Tigo Pesa, Airtel Money
UgandaMTN Mobile Money, Airtel Money
RwandaMTN Mobile Money, Airtel Money
GhanaMTN Mobile Money, AirtelTigo Money
NigeriaMTN MoMo (coming soon)

πŸš€ Next Steps​

  1. Mobile Money Integration - Setup payments
  2. Payouts Guide - Send disbursements
  3. Wallet Management - Manage your balance
  4. API Reference - View all endpoints
  5. Tutorial - Complete integration guide

πŸ†˜ Need Help?​


Ready to start accepting payments? Get API keys β†’