Py MoMo SDK for African Mobile Money and Payment Rails
A strictly typed Python SDK for MTN Mobile Money, Airtel Money, Wave, Safaricom M-Pesa, Paystack, Flutterwave, and Orange Money behind a unified PaymentRouter. Built with synchronous and asynchronous parity, automatic token caching, strict input validation, and verified webhook security.
Supported products and providers¶
Py MoMo SDK covers every MTN MoMo Open API product alongside Airtel Money and pan-African payment gateways behind a unified routing layer.
MTN MoMo
Collection
Request payments, initiate withdrawals, query balances, and exchange CIBA OAuth2 consent tokens.
Explore collectionMTN MoMo
Disbursement and remittance
Execute subscriber transfers, v2 deposits, refunds, wallet-to-wallet remittances, and account validation.
Explore disbursementAirtel Open API
Airtel Money
Initiate USSD Push collections, RSA-encrypted PIN disbursements, status inquiries, and wallet balances.
Explore Airtel MoneyMulti-provider
PaymentRouter and 7 rails
Route across MTN MoMo, Airtel Money, Wave, Safaricom M-Pesa, Paystack, Flutterwave, and Orange Money.
Explore providersInstall and query a balance in ten lines¶
Install py-momo-sdk from PyPI and import the py_momo_sdk package:
from py_momo_sdk import ProductConfig, PyMomoSDK, PyMomoSDKConfig
config = PyMomoSDKConfig(
environment="sandbox",
collection=ProductConfig(
subscription_key="your-subscription-key",
api_user="550e8400-e29b-41d4-a716-446655440000",
api_key="your-api-key",
),
)
with PyMomoSDK(config) as client:
balance = client.collection.get_balance()
print(f"Balance: {balance.available_balance} {balance.currency}")
Sync and async parity
Switch cleanly between synchronous and asynchronous clients across all 7 providers and PaymentRouter with identical method signatures, Pydantic v2 models, and thread-safe or async-safe token refresh locking.
Security by default
Every client enforces HTTPS endpoints, disables automatic HTTP redirects, bounds response sizes, validates canonical UUID v4 references, redacts credentials from logs and tracebacks, and verifies webhook signatures and source IPs.
Explore the guides¶
- Quickstart guide
- Authentication configuration
- Multi-provider orchestration
- Resilience and observability
- Collection API reference
- Disbursement API reference
- Remittance API reference
- Airtel Money reference
- Sandbox provisioning
- Webhook processing
- Asynchronous client support
- Error handling
- Command line interface
- Changelog
- Contributing guide