vatly / vatly-fluent-php
Framework-agnostic fluent PHP SDK for Vatly, the European Merchant of Record for AI, software and digital products
Requires
- php: ^8.1
- vatly/vatly-api-php: ^0.1.0-alpha.36
Requires (Dev)
- mockery/mockery: ^1.6
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v0.8.0-alpha.33
- v0.8.0-alpha.32
- v0.8.0-alpha.31
- v0.8.0-alpha.30
- v0.8.0-alpha.29
- v0.8.0-alpha.28
- v0.8.0-alpha.27
- v0.8.0-alpha.26
- v0.8.0-alpha.25
- v0.8.0-alpha.24
- v0.8.0-alpha.23
- v0.8.0-alpha.22
- v0.8.0-alpha.21
- v0.8.0-alpha.20
- v0.8.0-alpha.19
- v0.8.0-alpha.18
- v0.8.0-alpha.17
- v0.8.0-alpha.16
- v0.8.0-alpha.15
- v0.8.0-alpha.14
- v0.8.0-alpha.13
- v0.8.0-alpha.12
- v0.8.0-alpha.11
- v0.8.0-alpha.10
- v0.8.0-alpha.9
- v0.8.0-alpha.8
- v0.8.0-alpha.7
- v0.8.0-alpha.6
- v0.8.0-alpha.5
- v0.8.0-alpha.4
- v0.8.0-alpha.3
- v0.8.0-alpha.2
- v0.8.0-alpha.1
- v0.7.0-alpha.1
- v0.6.0-alpha.3
- v0.6.0-alpha.2
- v0.6.0-alpha.1
- v0.5.0-alpha.1
- v0.4.0-alpha.3
- v0.4.0-alpha.2
- v0.4.0-alpha.1
- v0.3.0-alpha.2
- v0.3.0-alpha.1
- v0.2.0-alpha.2
- v0.2.0-alpha.1
- v0.1.0-alpha.2
- v0.1.0-alpha.1
- dev-feat/payment-failed-lines
- dev-copy/storybrand-pass-1
- dev-feat/order-cancellation-reason
- dev-claude/adopt-simulate-order-payment
- dev-claude/practical-williamson-fadbf5
- dev-claude/ecstatic-heyrovsky-0be88f
- dev-feat/testmode-on-contracts
- dev-refactor/consume-webhook-event-factory-alpha19
- dev-refactor/webhooks-from-payload
- dev-feat/money-typed-events-alpha18
- dev-feat/persist-order-lines
- dev-claude/ci-phpstan
- dev-feat/grace-period-completed-reaction
- dev-fix/getrefund-optional-bc
- dev-fix/58-parse-mandate-from-webhook
- dev-chore/bump-api-php-alpha-12
- dev-claude/optimistic-kapitsa-377ee8
- dev-claude/cranky-roentgen-399897
- dev-claude/clever-chebyshev-a6addc
- dev-claude/silly-williams-044f20
- dev-feat/v0.8.0-alpha.2-additional-payload
- dev-feat/repo-reader-writer-split
- dev-feat/wp-driver-gaps
- dev-docs/recipes-sealed-owner
- dev-docs/readme-driver-guide
- dev-feat/order-handle-derived-predicates
- dev-feat/composition-root
- dev-feat/expose-config-and-signature-constant
- dev-feat/subscription-resume
This package is auto-updated.
Last update: 2026-11-20 09:12:52 UTC
README
Vatly Fluent PHP
Fluent billing flows for PHP, powered by Vatly, the European Merchant of Record for AI, software and digital products.
Alpha — under active development. Every alpha release may include breaking changes. Lock the version you install and review the release notes before upgrading.
Create hosted checkouts, change subscriptions, and sync orders through verified webhooks. Fluent builds on vatly/vatly-api-php and lets you keep your framework and database.
Install
Requires PHP 8.1+ and Composer. Keep your API key on the server.
composer config minimum-stability alpha
composer config prefer-stable true
composer require vatly/vatly-fluent-php
Fluent and the underlying vatly/vatly-api-php SDK are alpha, so allow alpha releases first. prefer-stable keeps your other dependencies on stable releases. Composer installs the latest alpha and records it in composer.lock.
Start a subscription checkout
After loading vendor/autoload.php, call this function with your key and authorized customer and plan IDs from the same storefront and mode:
use Vatly\Fluent\CustomerProfile; use Vatly\Fluent\Vatly; function startSubscription(string $apiKey, string $customerId, string $planId): string { $vatly = Vatly::apiOnly($apiKey); $checkout = $vatly->subscriptionBuilder(new CustomerProfile(vatlyId: $customerId)) ->toPlan($planId) ->withRedirectUrlSuccess('https://app.example.com/billing/return') ->withRedirectUrlCanceled('https://app.example.com/billing/canceled') ->create(); return $checkout->links->checkoutUrl->href; }
Redirect the browser to the returned URL. Confirm payment with webhooks, not the return page. Checkout builders work without storage wiring; add repositories when your application needs local billing records.
Choose the right package
- Laravel app: use vatly/vatly-laravel. It wires Fluent for you.
- Plain PHP or another framework: use this package for builders, subscription handles, customer bindings, and webhook persistence contracts. You supply routes, storage, transactions, and authorization.
- Only direct API requests: use vatly/vatly-api-php. It provides the typed HTTP client without Fluent's integration layer.
Documentation
Start with the overview, or read the live PHP Fluent docs.
- Configuration
- Core concepts
- Customers
- Checkouts
- Subscriptions
- Customer portal
- Webhooks
- Event flow
- Orders
- Testing
- Host tables
For request and response fields, see the API reference.
Contributing
Run composer test and composer analyse. See CONTRIBUTING.md.
License
MIT
