aioplatega

Async Python SDK for the Platega payment API.

Fully async

Built on top of aiohttp with lazy connection pool.

Type-safe

Pydantic v2 models with full type annotations.

Command pattern

aiogram-style method objects for every API endpoint.

Error handling

Typed exception hierarchy for every HTTP status.

Installation

pip install aioplatega
uv add aioplatega
poetry add aioplatega

Quick example

import asyncio
from aioplatega import Platega, PaymentMethodInt, PaymentDetails

async def main():
    async with Platega(merchant_id="your-id", secret="your-secret") as client:
        result = await client.create_transaction(
            payment_method=PaymentMethodInt.SBP_QR,
            payment_details=PaymentDetails(amount=100.0, currency="RUB"),
        )
        print(result.transaction_id, result.status)

asyncio.run(main())