Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Vatly Fluent for Python

Alpha — under active development. Every alpha release may include breaking changes. Pin exact versions during alpha.

Integrate Vatly billing without tying your application to a framework or database. Fluent adds chainable checkout/subscription builders, customer and subscription handles, pluggable persistence, and a signed webhook-to-domain-event pipeline on top of vatly-api-python. Your application owns authentication, entitlements, storage, transactions and jobs. Python 3.10+, fully typed, async-first.

Install

Once both packages are published:

pip install vatly-fluent-python==0.1.0a2 vatly-api-python==0.1.0a2

Nothing is published yet. For development, run .agents/setup or uv sync --locked. The versioned wheel under vendor/ bootstraps the unpublished SDK for uv only; normal package metadata depends on the exact SDK version from PyPI. It is not copied into Fluent's wheel. See provenance.

First checkout

from vatly import AsyncVatlyClient, RequestOptions
from vatly_fluent import Vatly, Wiring


async def start_subscription(plan_id: str, purchase_id: str):
    async with AsyncVatlyClient() as api:  # reads VATLY_API_KEY
        vatly = Vatly(
            Wiring(
                api=api,
                redirect_url_success="https://app.example.com/billing/return",
                redirect_url_canceled="https://app.example.com/billing/canceled",
            )
        )
        checkout = await (
            vatly.subscribe()
            .to_plan(plan_id)
            .with_quantity(3)
            .with_trial_days(14)
            .with_metadata({"purchaseId": purchase_id})
            .create(options=RequestOptions(idempotency_key=f"subscribe:{purchase_id}"))
        )
        return checkout.get_url()

This creates a checkout, not a subscription. Confirm payment through signed webhooks, not redirects. No API calls happen until create(). Use a new builder per purchase and persist a stable operation ID before sending. SDK errors pass through unchanged; FluentError means invalid local input or missing wiring.

Connect your own entities and storage

Wire CheckoutRecords, Repository[LocalSubscription], Repository[Stored[Order]], and WebhookCalls to your application's database. For entity-linked checkouts:

from vatly_fluent import EntityRef

# In an authorized handler, with vatly.wiring.checkouts configured:
builder = vatly.subscribe().to_plan(plan_id).for_entity(EntityRef("team", team_id))

Ownership follows your stored checkout → order → subscription links. It never falls back to customerId, which is only billing identity and may be shared or null. Metadata is correlation data, not authorization. A signed webhook authenticates Vatly's snapshot; it does not authorize a browser-provided entity ID.

Initial order lines may carry productType="subscription" and the intended subscription ID (core PR #2910). Historical subscription_plan lines remain plan references. Fluent never guesses a subscription from a plan or quantity. reconcile_checkout() handles bounded 404 recovery and returns unresolved IDs; an intended ID alone is not evidence of active service.

Learn the integration

Develop

uv sync --locked
uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run pytest
uv build
uv run twine check dist/*
uv run python scripts/check_package.py

CI runs these checks across Python 3.10–3.14. Release workflows are prepared but require PyPI trusted-publisher configuration and an explicitly published GitHub release. No release is triggered by pushing main.

Metadata

Release files for vatly-fluent-python 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vatly-fluent-python 0.1.0a2
File Size Uploaded Provenance Actions
vatly_fluent_python-0.1.0a2.tar.gz 68.4 kB With provenance Details for vatly_fluent_python-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vatly-fluent-python 0.1.0a2
File Interpreter ABI Platform Actions
vatly_fluent_python-0.1.0a2-py3-none-any.whl Python 3 none any Details for vatly_fluent_python-0.1.0a2-py3-none-any.whl

Total release size: 85.0 kB

Release files / vatly_fluent_python-0.1.0a2.tar.gz

Download URL vatly_fluent_python-0.1.0a2.tar.gz
Size 68.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8fbeb64ef9e32d1c796fea2eb2b9a961b83e3db48e2eb1daa4c24009ef48f1c7
BLAKE2b-256 checksum
How to use checksums
4414a60dfaf33cebff0a1f4f42ad8497bc2fd18bf55fe96c8fef06f4460e7ef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / vatly_fluent_python-0.1.0a2-py3-none-any.whl

Download URL vatly_fluent_python-0.1.0a2-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d325da9d883c57763846d7237f50d015475dcdcf2c544a7b2fc5f8728586b300
BLAKE2b-256 checksum
How to use checksums
cf336fc4e25e9b90f1b5eab0bb48e8e0cb8891d866734c4105fad2d8b3a88923
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for vatly-fluent-python 0.1.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vatly_fluent_python-0.1.0a2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page