Accrue

Billing state, modeled clearly.

Accrue is a Phoenix-era billing library: subscriptions, invoices, checkout, webhooks, and the rest of the Stripe-shaped surface as plain Elixir—not a pile of controllers you fork forever. You keep auth, routes, and product code; Accrue models money and lifecycle and ships a Fake processor so tests and CI stay offline.

If you ship a SaaS on Elixir and want documentation you can hand to a teammate, plus a straight path from “runs on my laptop” to “looks like how we run in prod,” you are in the right place.

Start here

Install

Hex vs main: The {:accrue, "~> …"} line below tracks accrue/mix.exs@version on the branch you are reading (typically main on GitHub). Hex.pm publishes that train after release; use HexDocs for API docs matched to the Hex version you resolved.

If you also pull accrue_admin, match its ~> to the same train, and rely on a resolved mix.lock in production while you are tracking a single ~> line.

In mix.exs:

defp deps do
[
{:accrue, "~> 1.3.0"}
]
end

Then:

mix deps.get
mix accrue.install

After install, pick up the walkthrough from Start here (First Hour) above—no need to duplicate those steps here.

Invoice PDFs are Rendro-first by default, so the normal path no longer requires Chrome or ChromicPDF on the host. If you need the explicit Chromic compatibility path or the :invoice_pdf_adapter / :pdf_adapter split, see PDF Rendering.

Optional checks from the host app:

What you get

The LiveView dashboard ships as the sibling Hex package accrue_admin; pin it to the same version family as accrue when you add the operator UI.

Stability

Your supported integration surface—generated MyApp.Billing, use Accrue.Webhook.Handler, use Accrue.Test, AccrueAdmin.Router, Accrue.Auth, Accrue.ConfigError—is spelled out in Upgrade. Accrue is done enough for the 1.0.x line because the documented facade is the contract: breaking changes on the documented surface go through deprecation, not silent reshuffles, even within the 1.0.x series. That is the public stability boundary for a stable-core / demand-driven expansion posture.

The canonical SaaS billing loop is complete for this scope. We only reopen broad expansion when evidence is concrete and adopter-facing: a concrete adopter failure mode that shows up as a correctness/security/data-loss risk, a repeated support issue, an operational failure, or an explicit strategy change. Internal schemas, workers, and demo helpers are not part of the facade contract. See Maturity and maintenance for doctrine, and use Jobs to Be Done — Scope and maturity for the scoped narrative.

Generated files are yours after install. Accrue only refreshes pristine stamped copies on installer reruns; it does not stomp files you have edited.

Community

Contributing · Code of Conduct · Security

Keep Stripe credentials and webhook signing secrets in runtime configuration, not in the repo. Use Security for vulnerability reports.