aioplatega#
Async Python SDK for the Platega payment API.
Built on top of aiohttp with lazy connection pool.
Pydantic v2 models with full type annotations.
Reusable method objects for every API endpoint.
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())
Releases#
Versions are cut by release-please, which keeps a Release PR
open against main collecting the conventional-commit messages since the
last tag. Merging it bumps the version, writes CHANGELOG.md, tags, and
publishes to PyPI. Pushing code publishes nothing.
Specification sources#
Platega publishes its API in more than one place, and they do not fully agree. This library is built against all of them:
OpenAPI, one document per endpoint, linked from docs.platega.io/llms.txt. Append
.mdto any documentation URL to get the machine-readable spec for that page. This is the authority for paths, fields and schemas.The rendered pages at docs.platega.io, whose prose carries operational rules the schemas omit — the
metadata.userIdrequirement, callback URL restrictions, and the payout signing scheme.An older GitBook that still documents the exchange-rate endpoint and payment method
10, neither of which appears in the current reference.
Where the sources disagree, this library accepts the union and types the affected fields permissively, so a value one specification omits does not make a response unreadable.