Official Python SDK for integrating with the Redde Payments API.
This SDK allows developers to easily integrate Redde mobile money and payment services into Python applications.
- Receive Money (Mobile Money / Wallet)
- Send Money (Cashout)
- Transaction Status Check
- Async support using httpx
- Automatic retries with exponential backoff
- Typed responses using Pydantic
- Structured error handling
- Webhook signature verification
- Production-grade logging
Install locally:
pip install -e .Or once published:
pip install redde-python-sdkimportasynciofromredde.async_clientimportAsyncReddeClientfromredde.models.paymentimportReceiveMoneyRequestasyncdefmain():
client=AsyncReddeClient(
api_key="YOUR_API_KEY",
app_id="YOUR_APP_ID"
)
request=ReceiveMoneyRequest(
amount=10.50,
clientreference="order-1001",
clienttransid="txn-1001",
nickname="Customer Payment",
paymentoption="MTN",
walletnumber="0240000000"
)
response=awaitclient.receive_money(request)
print(response)
awaitclient.close()
asyncio.run(main())Initiates a mobile money payment request.
fromredde.models.paymentimportReceiveMoneyRequestrequest=ReceiveMoneyRequest(
amount=20,
clientreference="order-001",
clienttransid="txn-001",
nickname="Payment",
paymentoption="MTN",
walletnumber="0240000000"
)
response=awaitclient.receive_money(request){
"status": "OK",
"transactionid": "123456",
"checkouturl": "https://checkout.reddeonline.com/..."
}fromredde.models.paymentimportSendMoneyRequestrequest=SendMoneyRequest(
amount=50,
clientreference="withdrawal-001",
clienttransid="txn-002",
description="Customer withdrawal",
nickname="Customer",
paymentoption="MTN",
walletnumber="0240000000"
)
response=awaitclient.send_money(request)status=awaitclient.get_status("123456")
print(status.status)
print(status.clienttransid)ifresponse.status=="OK":
print("Transaction initiated")Or using helper:
ifresponse.is_success:
print("Transaction successful")fromredde.exceptionsimportReddeApiExceptiontry:
response=awaitclient.receive_money(request)
exceptReddeApiExceptionase:
print("API Error:", e.status_code)
print("Response:", e.response)- ReddeException
- ReddeConnectionException
- ReddeTimeoutException
- ReddeApiException
- ReddeValidationException
fromredde.security.webhookimportverify_webhook_signatureis_valid=verify_webhook_signature(
payload=raw_body,
signature=signature_header,
secret=webhook_secret
)
ifnotis_valid:
raiseException("Invalid webhook")importlogginglogging.basicConfig(level=logging.INFO)Example logs:
INFO:redde:[436734ff] POST receive
INFO:redde:[436734ff] status=200 duration=105ms
Supported frameworks:
- FastAPI
- Django Async
- Flask (async)
- Any asyncio-based service
Default API endpoint:
https://api.reddeonline.com/v1
Override example:
client=AsyncReddeClient(
api_key="API_KEY",
app_id="APP_ID",
base_url="https://sandbox.reddeonline.com/v1"
)- Python 3.12.9
- httpx
- pydantic
- tenacity
pytest- Always verify webhooks
- Never expose your API key publicly
- Store credentials securely
MIT License