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)
- 🔄 Litestar 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 litestar import Litestar
from oxapay.webhook import WebhookRouter, PaymentWebhookEvent
webhook = WebhookRouter(
merchant_api_key="your_key",
path="/webhook"
)
app = Litestar(route_handlers=[webhook.router])
@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-litestar 0.3.2
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_litestar-0.3.2.tar.gz | 146.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oxapay_litestar-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 169.2 kB
Release files / oxapay_litestar-0.3.2.tar.gz
| Download URL | oxapay_litestar-0.3.2.tar.gz |
|---|---|
| Size | 146.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d85b49bd5bd3e7f87b76b927377d9ee9f61e2e9d255afc91f490536cc4716e66
|
|
BLAKE2b-256 checksum How to use checksums |
18083bef418a97aeaea0666401c21b5cb6fbd80c58d1cb7286904623da90fd7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / oxapay_litestar-0.3.2-py3-none-any.whl
| Download URL | oxapay_litestar-0.3.2-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
949ca71c9f80fea2d32e4234e58169bba69c3e89c462d933bba1f27db14a8a9f
|
|
BLAKE2b-256 checksum How to use checksums |
b3e94d98d5db7141a5fa86e8c41fff3072976da10046b8f19fcf96c59bc9faca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|