Search by

vatly / vatly-fluent-php

sandervanhooft

Framework-agnostic fluent PHP SDK for Vatly, the European Merchant of Record for AI, software and digital products

Package info

github.com/Vatly/vatly-fluent-php

Issues

pkg:composer/vatly/vatly-fluent-php

Statistics

Installs: 3 322

Dependents: 1

Suggesters: 0

Stars: 2

v0.8.0-alpha.33 2026-11-20 09:12 UTC

This package is auto-updated.

Last update: 2026-11-20 09:12:52 UTC


README

Vatly Fluent PHP

Vatly Fluent PHP

Latest Version on Packagist Tests

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.

For request and response fields, see the API reference.

Contributing

Run composer test and composer analyse. See CONTRIBUTING.md.

License

MIT