Skip to content

Billing 0.1.0: Orders, invoices, subscriptions and payments for PhoenixKit

Billing 0.1.0 is the first release of the PhoenixKit billing module as its own package. It gives a Phoenix site orders, invoices and receipts, subscriptions that renew on their own, several currencies, and payments through Stripe, PayPal or Razorpay.

Orders, invoices and payments

An order holds line items and moves from draft through pending and confirmed to paid, or to cancelled or refunded. An invoice made from it goes from draft to sent, then to paid, overdue or void, and a paid invoice gets a receipt. Every payment and refund is recorded as a transaction, and refunds can produce a credit note. Invoices, receipts, credit notes and payment confirmations each have a print view.

Payments can be made by bank transfer or through a provider’s hosted checkout. Stripe, PayPal and Razorpay report back through webhooks at /webhooks/billing/stripe, /webhooks/billing/paypal and /webhooks/billing/razorpay.

Subscriptions

Subscription Types define the price, the billing interval and an optional trial. Subscriptions are kept in the site’s own database rather than at the provider, and a daily background job renews them. When a renewal payment fails, the subscription gets a grace period, three days by default, with up to three retries before it is cancelled.

Where it shows

The admin gets a Billing section with Dashboard, Orders, Invoices, Transactions, Subscriptions, Subscription Types, Billing Profiles and Currencies, plus Payment Providers in the settings. The billing settings hold the default currency, the order, invoice and receipt prefixes, the invoice due days, tax, and the company and bank details shown on invoices and receipts. Billing profiles store an individual’s or a company’s details and address, and check a company’s EU VAT number. Signed-in users get My Orders and Billing Profiles pages of their own.

Upgrading

Add {:phoenix_kit_billing, "~> 0.1.0"}, run mix deps.get, then mix phoenix_kit_billing.install, which adds the module to the Tailwind sources in app.css and prints the next steps: a billing Oban queue, a daily cron entry for PhoenixKit.Modules.Billing.Workers.SubscriptionRenewalWorker, the billing supervisor in the app’s tree, and mix phoenix_kit.update for the billing tables. Then enter provider keys under Payment Providers and turn the module on in Admin → Modules.

Full release notes: Billing 0.1.0

0.1.0 · 28 March 2026

Added

  • Initial billing module with PhoenixKit.Module behaviour
  • Multi-currency support with exchange rates
  • Billing profiles for individuals and companies
  • Order management with line items and status tracking
  • Invoice generation with receipt functionality (draft → sent → paid/overdue/void)
  • Transaction tracking with refunds and credit notes
  • Subscription management with renewal cycles and dunning
  • Subscription type definitions (pricing, intervals, trial periods)
  • Payment provider architecture (Stripe, PayPal, Razorpay)
  • Internal subscription control (subscriptions managed in DB, not by providers)
  • Webhook processing for all supported providers
  • Oban workers for subscription renewals and dunning
  • PubSub events for real-time LiveView updates
  • Admin LiveViews: dashboard, orders, invoices, transactions, subscriptions, billing profiles, currencies, settings
  • User dashboard: My Orders, Billing Profiles
  • Print views: invoice, receipt, credit note, payment confirmation
  • Centralized path helpers via Paths module
  • Install mix task

Billing 0.1.0. Install or update: {:phoenix_kit_billing, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.