Hanzo Billing
Subscription billing, metering, and invoicing
Recurring subscriptions, usage-based pricing, prorated upgrades, dunning, and tax. One API for every billing model — flat, tiered, volume, graduated, and metered.
Every Pricing Model, One API
From simple subscriptions to complex metered usage with overages.
Subscriptions
Recurring plans with proration, trials, coupons, add-ons, and quantity-based billing. Built-in upgrade/downgrade flows.
Usage Metering
Real-time event ingestion at scale. Aggregate by sum, max, unique, or last value. Tiered, volume, or graduated rates.
Invoicing
PDF invoices, hosted payment pages, automatic line-item generation, and credit notes. Localized in 30+ languages.
Dunning
Configurable retry schedules, smart card updaters, email reminders, and grace periods. Recover failed payments automatically.
Tax Compliance
Automatic tax calculation for US sales tax, EU VAT, GST, and 50+ jurisdictions. Stripe Tax and Avalara integrations.
Webhooks & Events
Subscribe to invoice.created, subscription.updated, charge.failed, and 40+ events. At-least-once delivery with retries.
Meter Anything. Bill Anything.
import { Hanzo } from '@hanzo/billing';
const billing = new Hanzo({ apiKey: process.env.HANZO_API_KEY });
// Report usage in real time
await billing.usage.record({
customer: 'cus_abc123',
meter: 'api_requests',
value: 1,
timestamp: new Date(),
});
// Subscribe with metered pricing
await billing.subscriptions.create({
customer: 'cus_abc123',
items: [{ price: 'price_api_metered' }],
payment_behavior: 'default_incomplete',
});