Python Fluent
Build checkout, customer and subscription flows without tying billing to a web framework. Fluent composes the async SDK and your storage driver. Vatly is the European Merchant of Record for AI, software and digital products.
Alpha — under active development. Every alpha release may include breaking changes. Pin exact versions during alpha.
Install and create a checkout
python -m pip install vatly-fluent-python==0.1.0a3
Python 3.10+ is required. This installs vatly-api-python==0.1.0a3 too. Set
VATLY_API_KEY on the server, then run this async function with your event loop.
from vatly import AsyncVatlyClient, RequestOptions
from vatly_fluent import Vatly, Wiring
async def example():
async with AsyncVatlyClient() as api:
vatly = Vatly(
Wiring(
api=api,
redirect_url_success="https://app.example.com/billing/success",
redirect_url_canceled="https://app.example.com/billing/canceled",
)
)
checkout = (
await vatly.checkout_builder()
.with_items(
[
{"id": "one_off_product_example", "quantity": 1},
]
)
.create(options=RequestOptions(idempotency_key="purchase:42"))
)
return checkout.get_url()
Replace the product ID and persist the purchase key before making the request. Redirect the buyer to the URL. This minimal example does not store ownership or process webhooks; add storage before granting product access.
Build your integration
Functions in these guides accept the configured vatly instance from
Configuration. Await them inside your application's async
lifespan. IDs and billable entities must be authorized by your application.
| Guide | Task |
|---|---|
| Configuration | Wire the SDK, redirects and storage |
| Core concepts | Implement drivers and preserve ownership |
| Checkouts | Sell a cart or a subscription |
| Customers | Create, bind and look up billing identities |
| Customer portal | Send a buyer to hosted account management |
| Subscriptions | Change plans, cancel, resume and reconcile |
| Orders | Read invoices, lines and reversals |
| Webhooks | Persist signed events once in a transaction |
| Testing | Run a checkout without network access |
| Porting | Map JS/PHP concepts to Python |
| Development | Set up, test and build the package |
API reference documents the underlying
requests. These examples are executed with published 0.1.0a3 packages and local
fixtures; no real payments or account changes occur in documentation tests.