Payaza Python SDK
Unofficial Python SDK for the Payaza Africa API.
Installation
pip install payaza
For local development:
git clone https://github.com/0xAfterSnow/payaza-python
cd payaza-python
pip install -e ".[dev]"
Quick start
from payaza import Payaza
# Live
client = Payaza(api_key="your-live-key")
# Test / sandbox — uses X-TenantID: test on APIs that require it
client = Payaza(api_key="your-test-key", sandbox=True)
Payaza uses a single base URL (https://api.payaza.africa) with a fixed /live/ path prefix for both environments. Test vs live is controlled by your API key and, where required, X-TenantID.
Authentication headers
| Header | When |
|---|---|
Authorization: Payaza <base64-key> |
Always |
X-TenantID: test | live |
Only APIs that require it (transfers, account enquiry, bank codes, sub-accounts, MoMo collections, …) |
X-ProductID: app |
Only MoMo / XOF / ZAR / SLE collections |
The SDK does not attach tenant/product headers globally. Resource methods that need them call client.tenant_headers() or client.product_headers() internally.
See the official authentication guide.
Webhooks
Payaza signs each webhook body with HMAC-SHA512 and sends the Base64 digest in x-payaza-signature. Hash the raw request body with your webhook secret (not Base64-encoded):
from payaza import verify_signature
def handle(raw_body: bytes, signature: str, secret: str) -> None:
if not verify_signature(raw_body, signature, secret):
raise PermissionError("invalid webhook signature")
Signed transfers
Accounts activated by Payaza for signed payouts send X-Payaza-Signature on Initiate A Transfer. Pass the same style of secret:
client = Payaza(api_key="your-live-key", payout_secret_key="your-payout-secret")
You can also pass secret_key= on a single client.payouts.initiate_payout(...) call. The SDK hashes the exact JSON body it sends.
Implemented resources
| Resource | Methods |
|---|---|
client.collections |
Card charge (optional NGN PIN), 3DS check, card status/refund status, tokenization, token charge/list/delete, Apple/Google Pay initiate |
client.virtual_accounts |
Create dynamic/static VA, get status, fund test VA (sandbox), collection status by txn/merchant ref |
client.payouts |
Initiate transfer (single or multi-beneficiary) |
client.accounts |
View main accounts (balance / payazaAccountReference), account name enquiry |
client.transactions |
Transfer transaction status |
client.misc |
Bank codes by currency |
client.momo_collections |
MoMo/XOF/ZAR/SLE process collection, status, XOF OTP, sandbox fund |
client.refunds |
Initiate refund, refund history, chargeback requests/accept-reject/history |
client.auth_capture |
Authorize, capture, void, get/list authorizations |
client.sub_accounts |
Create sub-account, view sub-account details |
client.split_settlements |
Create, list, update, delete split settlement accounts |
client.eur_accounts |
Acceptable IDs, request user/corporate EUR subaccount, list/get requests, list EUR subaccounts |
client.branches |
List merchant branches |
client.subscriptions |
Plans, create/list/get subscription, pause/resume/cancel/change-plan, charge-now/custom, charges/events/upcoming, invoices |
Examples
# Main accounts — balances + payazaAccountReference for payouts
accounts = client.accounts.view_main_accounts()
ngn = next(a for a in accounts["data"] if a["currency"] == "NGN")
account_reference = ngn["payazaAccountReference"]
# Bank codes (requires X-TenantID)
banks = client.misc.get_bank_codes("NGN")
# Name enquiry before payout
details = client.accounts.fetch_account_details(
currency="NGN",
bank_code="000013",
account_number="0123456789",
)
# Initiate transfer — sender is nested into each beneficiary
response = client.payouts.initiate_payout(
transaction_type="nuban",
payout_amount=1000,
transaction_pin=1234,
account_reference=account_reference,
currency="NGN",
country="NGA",
payout_beneficiaries=[{
"credit_amount": 1000,
"account_number": "0123456789",
"account_name": "John Doe",
"bank_code": "000013",
"narration": "Test payout",
"transaction_reference": "TXN-001",
}],
sender={
"sender_name": "Jane Doe",
"sender_phone_number": "08012345678",
"sender_address": "Lagos, Nigeria",
},
)
Runnable scripts live under examples/.
Development
pip install -e ".[dev]"
pytest --cov=payaza
Contributing
PRs are welcome! Please open an issue first to discuss what you'd like to change.
⚠️ Disclaimer
This is an unofficial SDK and is not affiliated with or endorsed by Payaza Africa Limited. Endpoint paths and request/response shapes are based on the public documentation at docs.payaza.africa — always cross-check against the latest official docs and update accordingly.
License
MIT © Shagbaor Agber
Metadata
Release files for payaza 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| payaza-1.0.0.tar.gz | 44.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| payaza-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.4 kB
Release files / payaza-1.0.0.tar.gz
| Download URL | payaza-1.0.0.tar.gz |
|---|---|
| Size | 44.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fb44dcc60d9fe1da8a1beb178ed9e1ea5343070906a5bab9a131ae46c53a1ec
|
|
BLAKE2b-256 checksum How to use checksums |
77aadb6c5c24817ff0f6c1bc26ec76850fb56f457d567a00c412fad2b952068d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Release files / payaza-1.0.0-py3-none-any.whl
| Download URL | payaza-1.0.0-py3-none-any.whl |
|---|---|
| Size | 34.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
176b4ca32248bab8d1ef219f0ab28a784b7adf86542740affbdd4c28861ca67e
|
|
BLAKE2b-256 checksum How to use checksums |
55f8c20c83dce22b3e1297b062b1c4eedf2e04a539c9affc338f8facd2eea940
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Security for payaza 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.