Vatly
Python Fluent

Python Fluent

Build checkout, customer and subscription flows without tying billing to a web framework.

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.

GuideTask
ConfigurationWire the SDK, redirects and storage
Core conceptsImplement drivers and preserve ownership
CheckoutsSell a cart or a subscription
CustomersCreate, bind and look up billing identities
Customer portalSend a buyer to hosted account management
SubscriptionsChange plans, cancel, resume and reconcile
OrdersRead invoices, lines and reversals
WebhooksPersist signed events once in a transaction
TestingRun a checkout without network access
PortingMap JS/PHP concepts to Python
DevelopmentSet 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.

Copyright © 2026