OxaPay Python Client
A fully-typed Python client for the OxaPay cryptocurrency payment gateway v1 API.
Features
- 🚀 Async-first with sync wrapper
- 🔒 Full type hints & Pydantic models
- 🌐 Complete API coverage (Merchant, Payout, Swap, System)
- 🔄 FastAPI webhook integration
Installation
pip install oxapay
For webhook handling:
pip install "oxapay[webhook]"
Quick Start
Create an Invoice
import asyncio
from oxapay import OxaPayClient, CreateInvoiceRequest
async def main():
async with OxaPayClient(merchant_api_key="your_key") as client:
invoice = CreateInvoiceRequest(
amount=100,
currency="USD",
order_id="order_123"
)
response = await client.create_invoice(invoice)
print(f"Payment URL: {response.data.payment_url}")
print(f"Track ID: {response.data.track_id}")
asyncio.run(main())
Sync Client
from oxapay.sync import SyncOxaPayClient, CreateInvoiceRequest
client = SyncOxaPayClient(merchant_api_key="your_key")
response = client.create_invoice(
CreateInvoiceRequest(amount=100, currency="USD")
)
print(response.data.payment_url)
Webhooks
from fastapi import FastAPI
from oxapay.webhook import WebhookRouter, PaymentWebhookEvent
app = FastAPI()
webhook = WebhookRouter(
app=app,
merchant_api_key="your_key",
path="/webhook"
)
@webhook.on_payment_paid
async def handle_payment(event: PaymentWebhookEvent):
print(f"Payment received: {event.track_id}")
API Coverage
- Merchant: Invoices, white-label, static wallets, payment info
- Payout: Send crypto, track payouts, balances
- Swap: Exchange rates, swap requests
- System: Prices, currencies, networks, status
Examples
See the examples/ directory for more detailed usage patterns.
License
MIT License - see LICENSE file for details.
Metadata
Release files for oxapay 0.3.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 | |
|---|---|---|---|
| oxapay-0.3.0.tar.gz | 125.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oxapay-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 149.1 kB
Release files / oxapay-0.3.0.tar.gz
| Download URL | oxapay-0.3.0.tar.gz |
|---|---|
| Size | 125.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5235daf8e91faa4e4ce1065aa51abba6b1fe0976eedfa3f30eb029f28f7af6a4
|
|
BLAKE2b-256 checksum How to use checksums |
4e8c9593d438e508b2ab1d42ee6ddef78180082bd509ba989c09d64d5cd6d864
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / oxapay-0.3.0-py3-none-any.whl
| Download URL | oxapay-0.3.0-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e0c5fedc4f322552946cb7464d547ccb9dc05f6f6b12854073b5062565f3d03
|
|
BLAKE2b-256 checksum How to use checksums |
03e21cd3104f878d374b03c302041334d03cd329566615495d76609faaad84e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|