Vatly
PHP Fluent

PHP Fluent

Sell a download, start a subscription, and keep your app's billing records in step with Vatly.

Sell a download, start a subscription, and keep your app's billing records in step with Vatly. 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.

Fluent adds checkout builders, subscription operations, customer bindings, and a webhook processing pipeline to vatly/vatly-api-php. You keep your database and framework. Fluent calls your storage contracts to save orders and subscriptions.

Start a subscription

Install the package using Configuration. This function creates a hosted checkout and returns the URL to send to the browser:

use Vatly\Fluent\CustomerProfile;
use Vatly\Fluent\Vatly;

function subscriptionCheckout(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;
}

Use a customer and plan from the same storefront and mode as your key. Authorize the signed-in user's access to that customer first. Redirect to the returned URL, then use Webhooks to confirm the subscription and grant access. The return page alone is not proof of payment.

Choose your layer

You needUse
Billing in a Laravel appvatly-laravel. It wires Fluent into Laravel for you.
Fluent billing flows in plain PHP, Symfony, WordPress, or a custom driverThis package. Start without storage; add repositories when you need local records.
A few direct API calls, without local billing statevatly-api-php. No Fluent layer required.

With the raw SDK you assemble checkout payloads and coordinate webhook persistence yourself. Fluent gives those common tasks names: toPlan(), swapAndInvoice(), updateBilling(), and webhookProcessor()->handle(). It does not supply tables, routes, authorization, transactions, or exactly-once delivery.

Guides

TaskPage
Install, set keys, redirects, and handle errorsConfiguration
Connect billables and storageCore concepts
Link your users to Vatly customersCustomers
Sell one-off products and subscriptionsCheckouts
Swap, cancel, resume, and update billingSubscriptions
Open hosted self-service billingCustomer portal
Verify deliveries and handle retries safelyWebhooks
Choose which events to persist or listen forEvent flow
Show invoices, lines, refunds, and chargebacksOrders
Test without charging a customerTesting
Reuse your existing order and subscription tablesHost tables

For request and response fields, see the API reference.

Copyright © 2026