Vatly
JavaScript Fluent

JavaScript Fluent

Create checkouts and manage billing with @getvatly/fluent on your server.

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

Create checkouts and manage billing with @getvatly/fluent on your server. Vatly is the European Merchant of Record for AI, software and digital products. Install the tested alpha pair:

npm install --save-exact @getvatly/sdk@0.3.0-alpha.4 @getvatly/fluent@0.1.0-alpha.2

Start a subscription

Use a customer and plan from the key's storefront and mode. Check that the signed-in user owns the customer before calling this function:

import { VatlyClient } from '@getvatly/sdk';
import { Vatly } from '@getvatly/fluent';

export async function startSubscription(apiKey: string, customerId: string, planId: string) {
  const vatly = new Vatly({
    api: new VatlyClient({ apiKey }),
    redirectUrlSuccess: 'https://app.example.com/billing/return',
    redirectUrlCanceled: 'https://app.example.com/billing/canceled',
  });
  const checkout = await vatly.subscribe({ vatlyId: customerId })
    .toPlan(planId)
    .withQuantity(1)
    .create();
  return checkout.getUrl(); // Redirect the customer's browser to this URL.
}

Redirect to the returned URL. Use webhooks to confirm payment, not the return page.

For one-off purchases, use checkoutBuilder.

Guides

TaskGuide
Set keys, redirects, and error handlingConfiguration
Connect your databaseCore concepts and storage
Link customers to your usersCustomers and bindings
Sell products or start subscriptionsCheckouts
Swap, cancel, resume, or update billingSubscriptions
Open invoice history and billing controlsCustomer portal
Verify and process eventsWebhooks
Read invoices, lines, and reversalsOrders
Test your integrationTesting

For field details, see the API reference. The OpenAPI spec is also available for tooling.

Copyright © 2026