# accrue v1.0.0 - Table of Contents Billing state, modeled clearly. ## Pages - [Accrue](readme.md) - Guides - [Auth Adapters](auth_adapters.md) - [Branding](branding.md) - [Configuration](configuration.md) - [Accrue Connect — Marketplace Platforms Guide](connect.md) - [Custom PDF Adapter](custom_pdf_adapter.md) - [Custom Processors](custom_processors.md) - [Email](email.md) - [Finance handoff: Stripe-native reporting](finance-handoff.md) - [First Hour](first_hour.md) - [Maturity and maintenance](maturity-and-maintenance.md) - [Usage metering](metering.md) - [Operator runbooks](operator-runbooks.md) - [Organization billing](organization_billing.md) - [PDF Rendering](pdf.md) - [Customer Portal Configuration Checklist](portal_configuration_checklist.md) - [Production readiness](production-readiness.md) - [Quickstart](quickstart.md) - [Release notes (plain-language)](release-notes.md) - [Sigra Integration](sigra_integration.md) - [Telemetry & Observability](telemetry.md) - [Testing Accrue Billing Flows](testing.md) - [Troubleshooting](troubleshooting.md) - [Upgrade Guide](upgrade.md) - [Webhook Gotchas](webhook_gotchas.md) - [Webhooks](webhooks.md) ## Modules - [Accrue](Accrue.md): Accrue — billing state, modeled clearly. - [Accrue.Actor](Accrue.Actor.md): Process-dictionary-backed actor context for the Events ledger (D-15). - [Accrue.Application](Accrue.Application.md): OTP Application module for Accrue — manages boot-time validation and the supervision tree. - [Accrue.Auth](Accrue.Auth.md): Behaviour + facade for host-app auth integration. - [Accrue.Auth.Default](Accrue.Auth.Default.md): Dev-permissive, prod-refuse-to-boot default `Accrue.Auth` adapter (D-40). - [Accrue.Auth.Mock](Accrue.Auth.Mock.md): Process-local `Accrue.Auth` adapter for host test suites. - [Accrue.Billable](Accrue.Billable.md): One-line macro that makes any host schema billable. - [Accrue.Billing](Accrue.Billing.md): Primary context module for Accrue billing operations. - [Accrue.Billing.Charge](Accrue.Billing.Charge.md): Ecto schema for the `accrue_charges` table. - [Accrue.Billing.ChargeActions](Accrue.Billing.ChargeActions.md): Charge / payment intent / setup intent write surface. - [Accrue.Billing.Coupon](Accrue.Billing.Coupon.md): Ecto schema for the `accrue_coupons` table. - [Accrue.Billing.CouponActions](Accrue.Billing.CouponActions.md): Coupon and promotion-code write surface. - [Accrue.Billing.Customer](Accrue.Billing.Customer.md): Ecto schema for the `accrue_customers` table. - [Accrue.Billing.Dunning](Accrue.Billing.Dunning.md): Pure policy module for dunning. - [Accrue.Billing.IntentResult](Accrue.Billing.IntentResult.md): Wraps Stripe intent-capable responses into the `intent_result` tagged union (D3-06..D3-08). - [Accrue.Billing.Invoice](Accrue.Billing.Invoice.md): Ecto schema for the `accrue_invoices` table. - [Accrue.Billing.InvoiceActions](Accrue.Billing.InvoiceActions.md): Invoice write surface. - [Accrue.Billing.InvoiceCoupon](Accrue.Billing.InvoiceCoupon.md): Ecto schema for the `accrue_invoice_coupons` redemption link table (D3-16). - [Accrue.Billing.InvoiceItem](Accrue.Billing.InvoiceItem.md): Ecto schema for the `accrue_invoice_items` table (D3-15). - [Accrue.Billing.InvoiceProjection](Accrue.Billing.InvoiceProjection.md): Deterministic decomposition of a processor (Stripe- or Fake-shaped) invoice into a flat attrs map ready for `Accrue.Billing.Invoice.changeset/2` plus a list of per-line attrs ready for `Accrue.Billing.InvoiceItem.changeset/2`. - [Accrue.Billing.Metadata](Accrue.Billing.Metadata.md): Stripe-compatible metadata validation and merge helpers. - [Accrue.Billing.MeterEvent](Accrue.Billing.MeterEvent.md): Ecto schema for `accrue_meter_events` — the metered billing audit ledger and transactional outbox. - [Accrue.Billing.MeterEventActions](Accrue.Billing.MeterEventActions.md): Metered billing write surface. - [Accrue.Billing.MeterEvents](Accrue.Billing.MeterEvents.md): Helper for asynchronous meter-event state transitions driven by Stripe webhooks. - [Accrue.Billing.PaymentMethod](Accrue.Billing.PaymentMethod.md): Ecto schema for the `accrue_payment_methods` table. - [Accrue.Billing.PaymentMethodActions](Accrue.Billing.PaymentMethodActions.md): Payment method write surface. - [Accrue.Billing.PromotionCode](Accrue.Billing.PromotionCode.md): Ecto schema for the `accrue_promotion_codes` table. - [Accrue.Billing.PromotionCodeProjection](Accrue.Billing.PromotionCodeProjection.md): Decomposes a processor promotion-code map (atom- or string-keyed) into a flat attrs map ready for `Accrue.Billing.PromotionCode.changeset/2`. - [Accrue.Billing.Query](Accrue.Billing.Query.md): Composable `Ecto.Query` fragments mirroring the `Accrue.Billing.Subscription` predicates. - [Accrue.Billing.Refund](Accrue.Billing.Refund.md): Ecto schema for the `accrue_refunds` table (D3-45). - [Accrue.Billing.RefundActions](Accrue.Billing.RefundActions.md): Refund write surface. - [Accrue.Billing.Subscription](Accrue.Billing.Subscription.md): Ecto schema for the `accrue_subscriptions` table. - [Accrue.Billing.SubscriptionActions](Accrue.Billing.SubscriptionActions.md): Write surface for subscription lifecycle operations. - [Accrue.Billing.SubscriptionItem](Accrue.Billing.SubscriptionItem.md): Ecto schema for the `accrue_subscription_items` table. - [Accrue.Billing.SubscriptionItems](Accrue.Billing.SubscriptionItems.md): Multi-item subscription surface. - [Accrue.Billing.SubscriptionProjection](Accrue.Billing.SubscriptionProjection.md): Translates a Stripe subscription API response into local Ecto changesets. - [Accrue.Billing.SubscriptionSchedule](Accrue.Billing.SubscriptionSchedule.md): Ecto schema for `accrue_subscription_schedules`. - [Accrue.Billing.SubscriptionScheduleActions](Accrue.Billing.SubscriptionScheduleActions.md): Write surface for Stripe SubscriptionSchedules. - [Accrue.Billing.SubscriptionScheduleProjection](Accrue.Billing.SubscriptionScheduleProjection.md): Decomposes a Stripe/Fake SubscriptionSchedule payload into the flat attrs map consumed by `Accrue.Billing.SubscriptionSchedule.changeset/2` and `force_status_changeset/2`. - [Accrue.Billing.Trial](Accrue.Billing.Trial.md): Trial end normalization (D3-38). - [Accrue.Billing.UpcomingInvoice](Accrue.Billing.UpcomingInvoice.md): Non-persistent struct representing a proration preview. - [Accrue.Billing.UpcomingInvoice.Line](Accrue.Billing.UpcomingInvoice.Line.md): A single line on an upcoming-invoice preview. - [Accrue.BillingPortal](Accrue.BillingPortal.md): Customer Billing Portal context. - [Accrue.BillingPortal.Session](Accrue.BillingPortal.Session.md): Stripe Customer Billing Portal session wrapper. - [Accrue.Checkout](Accrue.Checkout.md): Stripe Checkout integration facade. - [Accrue.Checkout.LineItem](Accrue.Checkout.LineItem.md): Helpers for constructing Stripe Checkout `line_items` array entries. - [Accrue.Checkout.Session](Accrue.Checkout.Session.md): Stripe Checkout Session wrapper. - [Accrue.Cldr](Accrue.Cldr.md): Provides the core functions to retrieve and manage the CLDR data that supports formatting and localisation. - [Accrue.Cldr.AcceptLanguage](Accrue.Cldr.AcceptLanguage.md): Parses HTTP `Accept-Language` header values as defined in [rfc2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4). - [Accrue.Cldr.Currency](Accrue.Cldr.Currency.md) - [Accrue.Cldr.Locale](Accrue.Cldr.Locale.md): Backend module that provides functions to define new locales and display human-readable locale names for presentation purposes. - [Accrue.Cldr.Money](Accrue.Cldr.Money.md): A backend module for Money. - [Accrue.Cldr.Number](Accrue.Cldr.Number.md): Formats numbers and currencies based upon CLDR's decimal formats specification. - [Accrue.Cldr.Number.Cardinal](Accrue.Cldr.Number.Cardinal.md): Implements cardinal plural rules for numbers. - [Accrue.Cldr.Number.Format](Accrue.Cldr.Number.Format.md): Functions to manage the collection of number patterns defined in Cldr. - [Accrue.Cldr.Number.Formatter.Decimal](Accrue.Cldr.Number.Formatter.Decimal.md) - [Accrue.Cldr.Number.Ordinal](Accrue.Cldr.Number.Ordinal.md): Implements ordinal plural rules for numbers. - [Accrue.Cldr.Number.PluralRule.Range](Accrue.Cldr.Number.PluralRule.Range.md): Implements plural rules for ranges - [Accrue.Cldr.Number.Symbol](Accrue.Cldr.Number.Symbol.md) - [Accrue.Cldr.Number.System](Accrue.Cldr.Number.System.md) - [Accrue.Cldr.Number.Transliterate](Accrue.Cldr.Number.Transliterate.md): Transliteration for digits and separators. - [Accrue.Cldr.Rbnf.NumberSystem](Accrue.Cldr.Rbnf.NumberSystem.md): Functions to implement the number system rule-based-number-format rules of CLDR. - [Accrue.Cldr.Rbnf.Ordinal](Accrue.Cldr.Rbnf.Ordinal.md): Functions to implement the ordinal rule-based-number-format rules of CLDR. - [Accrue.Cldr.Rbnf.Spellout](Accrue.Cldr.Rbnf.Spellout.md): Functions to implement the spellout rule-based-number-format rules of CLDR. - [Accrue.Clock](Accrue.Clock.md): Canonical time source for Accrue. - [Accrue.Config](Accrue.Config.md): Runtime configuration schema for Accrue, backed by `NimbleOptions`. - [Accrue.Connect](Accrue.Connect.md): Stripe Connect domain facade. - [Accrue.Connect.Account](Accrue.Connect.Account.md): Ecto schema for `accrue_connect_accounts` — the local projection of a Stripe Connected Account (D5-02, CONN-01/03). - [Accrue.Connect.AccountLink](Accrue.Connect.AccountLink.md): Onboarding/update bearer credential for a connected account. - [Accrue.Connect.LoginLink](Accrue.Connect.LoginLink.md): Express dashboard return credential for a connected account. - [Accrue.Connect.PlatformFee](Accrue.Connect.PlatformFee.md): Pure `Accrue.Money` math for platform fee computation. - [Accrue.Connect.Projection](Accrue.Connect.Projection.md): Decomposes a processor-shaped (Stripe- or Fake-produced) Connected Account payload into a flat attrs map ready for `Accrue.Connect.Account.changeset/2` (D5-02). - [Accrue.Credo.NoRawStatusAccess](Accrue.Credo.NoRawStatusAccess.md): ## Basics - [Accrue.Ecto.Money](Accrue.Ecto.Money.md): Two storage shapes for `%Accrue.Money{}` in Ecto schemas — both shipped in Phase 1 per D-02 and RESEARCH Open Question 5. - [Accrue.Emails.CardExpiringSoon](Accrue.Emails.CardExpiringSoon.md): Card-expiring-soon reminder email. - [Accrue.Emails.CouponApplied](Accrue.Emails.CouponApplied.md): Coupon applied notification. - [Accrue.Emails.Fixtures](Accrue.Emails.Fixtures.md): Canned assigns for every `Accrue.Emails.*` type. - [Accrue.Emails.InvoiceFinalized](Accrue.Emails.InvoiceFinalized.md): Invoice finalized notification. - [Accrue.Emails.InvoicePaid](Accrue.Emails.InvoicePaid.md): Invoice paid confirmation. - [Accrue.Emails.InvoicePaymentFailed](Accrue.Emails.InvoicePaymentFailed.md): Invoice payment-failed notification. - [Accrue.Emails.PaymentFailed](Accrue.Emails.PaymentFailed.md): Canonical payment-failed email. - [Accrue.Emails.PaymentSucceeded](Accrue.Emails.PaymentSucceeded.md): Receipt-style confirmation for a successful payment. - [Accrue.Emails.Receipt](Accrue.Emails.Receipt.md): Canonical receipt email. - [Accrue.Emails.RefundIssued](Accrue.Emails.RefundIssued.md): Refund issued notification. - [Accrue.Emails.SubscriptionCanceled](Accrue.Emails.SubscriptionCanceled.md): Subscription cancellation confirmation. - [Accrue.Emails.SubscriptionPaused](Accrue.Emails.SubscriptionPaused.md): Subscription-paused notification. - [Accrue.Emails.SubscriptionResumed](Accrue.Emails.SubscriptionResumed.md): Subscription-resumed notification. - [Accrue.Emails.TrialEnded](Accrue.Emails.TrialEnded.md): Trial-ended notification email. - [Accrue.Emails.TrialEnding](Accrue.Emails.TrialEnding.md): Trial-ending reminder email. - [Accrue.Events](Accrue.Events.md): Tamper-evident audit ledger for Accrue billing events. - [Accrue.Events.Event](Accrue.Events.Event.md): Ecto schema for a row in the append-only `accrue_events` table. - [Accrue.Events.Schemas](Accrue.Events.Schemas.md): Registry mapping Phase 3 event atoms to their canonical schema modules (D3-66, D3-68). - [Accrue.Events.Schemas.CardExpiringSoon](Accrue.Events.Schemas.CardExpiringSoon.md): Payload schema for `:"card.expiring_soon"` events (D3-66). - [Accrue.Events.Schemas.InvoicePaid](Accrue.Events.Schemas.InvoicePaid.md): Payload schema for `:"invoice.paid"` events (D3-66). - [Accrue.Events.Schemas.RefundCreated](Accrue.Events.Schemas.RefundCreated.md): Payload schema for `:"refund.created"` events (D3-66). - [Accrue.Events.Schemas.SubscriptionCanceled](Accrue.Events.Schemas.SubscriptionCanceled.md): Payload schema for `:"subscription.canceled"` events (D3-66). - [Accrue.Events.Schemas.SubscriptionCreated](Accrue.Events.Schemas.SubscriptionCreated.md): Payload schema for `:"subscription.created"` events (D3-66). - [Accrue.Events.Schemas.SubscriptionPlanSwapped](Accrue.Events.Schemas.SubscriptionPlanSwapped.md): Payload schema for `:"subscription.plan_swapped"` events (D3-66). - [Accrue.Events.Schemas.SubscriptionUpdated](Accrue.Events.Schemas.SubscriptionUpdated.md): Payload schema for `:"subscription.updated"` events (D3-66). - [Accrue.Events.Upcaster](Accrue.Events.Upcaster.md): Upcaster behaviour for event `schema_version` evolution (D3-69). - [Accrue.Events.UpcasterRegistry](Accrue.Events.UpcasterRegistry.md): Chain composition for event schema-version upcasting. - [Accrue.Events.Upcasters.V1ToV2](Accrue.Events.Upcasters.V1ToV2.md): Example upcaster from `schema_version: 1` to `schema_version: 2`. - [Accrue.Install.Fingerprints](Accrue.Install.Fingerprints.md): No-clobber primitives for Accrue-generated host files. - [Accrue.Install.Options](Accrue.Install.Options.md): Strict option parsing for `mix accrue.install`. - [Accrue.Install.Patches](Accrue.Install.Patches.md): Safe host-file patch builders and manual snippets for Accrue installs. - [Accrue.Install.Project](Accrue.Install.Project.md): Phoenix host project discovery for `mix accrue.install`. - [Accrue.Install.Templates](Accrue.Install.Templates.md): Renders host-owned installer templates. - [Accrue.Invoices](Accrue.Invoices.md): Invoice facade (D6-04). Owns lazy PDF rendering + storage delegation. - [Accrue.Invoices.Components](Accrue.Invoices.Components.md): Phoenix.Component function components shared by email and PDF. - [Accrue.Invoices.Layouts](Accrue.Invoices.Layouts.md): HEEx layout wrappers for PDF (and optionally, shared email shells). - [Accrue.Invoices.Render](Accrue.Invoices.Render.md): Invoice render orchestration — builds a single `RenderContext` and exposes format-helper functions shared by the email + PDF pipelines. - [Accrue.Invoices.RenderContext](Accrue.Invoices.RenderContext.md): Format-neutral hydrated invoice payload (D6-04). - [Accrue.Invoices.Styles](Accrue.Invoices.Styles.md): Static branding-aware inline-CSS lookup used by `Accrue.Invoices.Components` to stamp `style="..."` attributes on every structural element. - [Accrue.Jobs.DetectExpiringCards](Accrue.Jobs.DetectExpiringCards.md): Scheduled Oban worker for expiring-card detection. - [Accrue.Jobs.DunningSweeper](Accrue.Jobs.DunningSweeper.md): Oban cron worker for the dunning grace-period overlay. - [Accrue.Jobs.MeterEventsReconciler](Accrue.Jobs.MeterEventsReconciler.md): Metered billing outbox reconciler. - [Accrue.Jobs.ReconcileChargeFees](Accrue.Jobs.ReconcileChargeFees.md): Daily backstop Oban worker for charge fees that weren't populated at create time (D3-46). - [Accrue.Jobs.ReconcileRefundFees](Accrue.Jobs.ReconcileRefundFees.md): Daily backstop Oban worker for refund fees that weren't populated at create time (D3-46). - [Accrue.Mailer](Accrue.Mailer.md): Behaviour + facade for the Accrue transactional email pipeline. - [Accrue.Mailer.Default](Accrue.Mailer.Default.md): Default `Accrue.Mailer` adapter — enqueues an Oban job on the `:accrue_mailers` queue that a worker later turns into a delivered email. - [Accrue.Mailer.Swoosh](Accrue.Mailer.Swoosh.md): Swoosh-backed delivery module for Accrue's transactional emails. - [Accrue.Mailer.Test](Accrue.Mailer.Test.md): Test adapter for `Accrue.Mailer` (D6-05). Replaces `Accrue.Mailer.Default` at the behaviour layer — intercepts `Accrue.Mailer.deliver/2` BEFORE Oban enqueue. Sends the intent tuple to the calling test pid and returns immediately. - [Accrue.Money](Accrue.Money.md): Accrue's canonical money value type — a thin, opinionated wrapper over the `:ex_money` currency table. - [Accrue.Oban.Middleware](Accrue.Oban.Middleware.md): Helper for setting `Accrue.Actor` operation_id from an Oban job (D3-63). - [Accrue.PDF](Accrue.PDF.md): Behaviour + facade for PDF rendering. - [Accrue.PDF.ChromicPDF](Accrue.PDF.ChromicPDF.md): ChromicPDF adapter for `Accrue.PDF` (D-32, D-33). - [Accrue.PDF.Null](Accrue.PDF.Null.md): Null `Accrue.PDF` adapter for Chrome-hostile deploys (D6-06). - [Accrue.PDF.Test](Accrue.PDF.Test.md): Chrome-free `Accrue.PDF` adapter for test environments (D-34). - [Accrue.Plug.PutConnectedAccount](Accrue.Plug.PutConnectedAccount.md): Stashes a per-request Connect `stripe_account` id into the process dictionary for the lifetime of the request. - [Accrue.Plug.PutOperationId](Accrue.Plug.PutOperationId.md): Sets `Accrue.Actor` operation_id from `conn.assigns[:request_id]`. - [Accrue.Processor](Accrue.Processor.md): The adapter contract between Accrue and payment processors. - [Accrue.Processor.Fake](Accrue.Processor.Fake.md): Deterministic in-memory `Accrue.Processor` adapter for tests and demos. - [Accrue.Processor.Fake.State](Accrue.Processor.Fake.State.md): Internal state struct for `Accrue.Processor.Fake`. - [Accrue.Processor.Idempotency](Accrue.Processor.Idempotency.md): Deterministic idempotency key and subject UUID derivation for Phase 3 processor operations (D3-60, D3-61, D3-64). - [Accrue.Processor.Stripe](Accrue.Processor.Stripe.md): Production Stripe adapter — wires all `Accrue.Processor` callbacks to `:lattice_stripe`. - [Accrue.Processor.Stripe.ErrorMapper](Accrue.Processor.Stripe.ErrorMapper.md): Translates raw `LatticeStripe` error shapes into `Accrue.Error` subtypes. - [Accrue.Repo](Accrue.Repo.md): Thin facade over the host-configured `Ecto.Repo`. - [Accrue.Router](Accrue.Router.md): Router helpers for mounting Accrue webhook endpoints. - [Accrue.Storage](Accrue.Storage.md): Behaviour + facade for pluggable PDF / asset storage. - [Accrue.Storage.Null](Accrue.Storage.Null.md): No-op `Accrue.Storage` adapter — the v1.0 default (D6-04). - [Accrue.Stripe](Accrue.Stripe.md): Stripe-specific helpers for host applications (D2-15). - [Accrue.Telemetry](Accrue.Telemetry.md): Telemetry conventions and helpers for Accrue. - [Accrue.Telemetry.Metrics](Accrue.Telemetry.Metrics.md): Default `Telemetry.Metrics` recipe for SRE teams. - [Accrue.Telemetry.OTel](Accrue.Telemetry.OTel.md): Optional OpenTelemetry bridge for Accrue telemetry spans. - [Accrue.Telemetry.Ops](Accrue.Telemetry.Ops.md): Ops-grade telemetry emit helper. - [Accrue.Test](Accrue.Test.md): Public test helper facade for host applications. - [Accrue.Test.Clock](Accrue.Test.Clock.md): Deterministic clock helpers for host tests. - [Accrue.Test.EventAssertions](Accrue.Test.EventAssertions.md): ExUnit-style assertions for Accrue's append-only event ledger. - [Accrue.Test.Factory](Accrue.Test.Factory.md): Phase 3 test factories (D3-79..85). - [Accrue.Test.Generators](Accrue.Test.Generators.md): StreamData generators for Phase 3 property tests (D3-81). - [Accrue.Test.MailerAssertions](Accrue.Test.MailerAssertions.md): ExUnit-style assertions for `Accrue.Mailer.Test` intent captures (D6-05). Symmetric with `Accrue.Test.PdfAssertions`. - [Accrue.Test.PdfAssertions](Accrue.Test.PdfAssertions.md): ExUnit-style assertions for `Accrue.PDF.Test` render captures (D-34). Symmetric with `Accrue.Test.MailerAssertions`. - [Accrue.Test.Webhooks](Accrue.Test.Webhooks.md): Synthetic webhook helpers for host tests. - [Accrue.Webhook.CachingBodyReader](Accrue.Webhook.CachingBodyReader.md): Custom body reader for `Plug.Parsers` that tees the raw body into `conn.assigns[:raw_body]` for webhook signature verification. - [Accrue.Webhook.ConnectHandler](Accrue.Webhook.ConnectHandler.md): Webhook handler for events arriving on the `:connect` endpoint. - [Accrue.Webhook.DefaultHandler](Accrue.Webhook.DefaultHandler.md): Non-disableable default handler for built-in state reconciliation. - [Accrue.Webhook.DispatchWorker](Accrue.Webhook.DispatchWorker.md): Oban worker for async webhook handler dispatch. - [Accrue.Webhook.Event](Accrue.Webhook.Event.md): Lean event struct passed to webhook handlers. - [Accrue.Webhook.Handler](Accrue.Webhook.Handler.md): Behaviour for webhook event handlers (D2-27). - [Accrue.Webhook.Ingest](Accrue.Webhook.Ingest.md): Transactional webhook event persistence and Oban job dispatch (D2-24). - [Accrue.Webhook.Plug](Accrue.Webhook.Plug.md): Core webhook ingestion plug. - [Accrue.Webhook.Pruner](Accrue.Webhook.Pruner.md): Oban cron worker for webhook event retention (D2-34). - [Accrue.Webhook.Signature](Accrue.Webhook.Signature.md): Webhook signature verification. Delegates entirely to `LatticeStripe.Webhook.construct_event!/4` (D2-22). - [Accrue.Webhook.WebhookEvent](Accrue.Webhook.WebhookEvent.md): Ecto schema for the `accrue_webhook_events` table. - [Accrue.Webhooks.DLQ](Accrue.Webhooks.DLQ.md): Dead-letter queue replay and retention for webhook events. - [Accrue.Workers.Mailer](Accrue.Workers.Mailer.md): Oban worker that delivers a transactional email asynchronously. - Exceptions - [Accrue.APIError](Accrue.APIError.md): Raised when a processor call fails for a reason that is neither a card error nor a rate limit (e.g., HTTP 500, unexpected payload). Pattern-match on `%Accrue.APIError{}` in retry logic. - [Accrue.ActionRequiredError](Accrue.ActionRequiredError.md): Raised when a Stripe PaymentIntent or SetupIntent transitions to `requires_action` (SCA / 3DS). The `:payment_intent` field carries the full PaymentIntent payload so callers can extract `client_secret` and drive the Stripe.js confirmation flow on the frontend. - [Accrue.Auth.StepUpUnconfigured](Accrue.Auth.StepUpUnconfigured.md): Raised when a destructive admin action requires step-up verification but the configured auth adapter does not implement the optional callbacks. - [Accrue.CardError](Accrue.CardError.md): Raised when the processor rejects a card (declined, expired, insufficient funds, etc.). Mirrors Stripe's card-error shape 1:1. - [Accrue.ConfigError](Accrue.ConfigError.md): Raised when `Accrue.Config` validation fails, or when a key is looked up that is neither set at runtime nor has a schema default. - [Accrue.DecodeError](Accrue.DecodeError.md): Raised when a processor response body cannot be decoded (malformed JSON, unexpected shape). The `payload` field holds the raw binary for debugging — treat as sensitive; do not log verbatim. - [Accrue.Error.InvalidState](Accrue.Error.InvalidState.md): Raised when a state-machine transition is attempted from an illegal source state (e.g., `pay_invoice/2` on a `:void` invoice, `resume/2` on an `:active` subscription). - [Accrue.Error.MultiItemSubscription](Accrue.Error.MultiItemSubscription.md): Raised when a legacy convenience call (e.g., `update_quantity/3`) is made against a subscription that has more than one `SubscriptionItem`. Multi-item subscriptions require `Accrue.Billing.update_items/3`; the convenience helpers enforce a single-item invariant. - [Accrue.Error.NoDefaultPaymentMethod](Accrue.Error.NoDefaultPaymentMethod.md): Raised when a charge or subscription call requires a default payment method and the customer has none set. Callers should surface a user-facing "add a payment method" prompt. - [Accrue.Error.NotAttached](Accrue.Error.NotAttached.md): Raised when a payment method is referenced for a customer it is not attached to (e.g., `set_default_payment_method/3` with a `pm_id` that belongs to a different customer). - [Accrue.Error.PdfDisabled](Accrue.Error.PdfDisabled.md): Raised / returned when the configured PDF adapter is `Accrue.PDF.Null`. Expected and terminal — callers MUST pattern-match and fall through to a non-PDF path (e.g., link to `hosted_invoice_url` instead of attaching a rendered binary). Oban workers MUST NOT treat this as a transient retry; it is a stable adapter configuration, not a failure. - [Accrue.EventLedgerImmutableError](Accrue.EventLedgerImmutableError.md): Raised when a caller attempts to UPDATE or DELETE a row in `accrue_events`. The append-only guarantee is enforced in two places - [Accrue.IdempotencyError](Accrue.IdempotencyError.md): Raised when the processor rejects an idempotency key replay (e.g., same key used for a different request body). Pattern-match on `%Accrue.IdempotencyError{}` to surface a user-facing "this request was already processed" message. - [Accrue.Money.MismatchedCurrencyError](Accrue.Money.MismatchedCurrencyError.md): Raised when `Accrue.Money` arithmetic is attempted across two different currencies. Per D-04, cross-currency math never silently coerces or returns a tagged tuple — it raises at the call site so the bug surfaces immediately. - [Accrue.PDF.RenderFailed](Accrue.PDF.RenderFailed.md): Raised from `Accrue.Workers.Mailer.perform/1` when `Accrue.Billing.render_invoice_pdf/2` returns a non-terminal `{:error, reason}` (i.e., not `%Accrue.Error.PdfDisabled{}` and not `:chromic_pdf_not_started`). Raising this exception lets Oban backoff handle transient render failures — the mailer job is retried per its `max_attempts` setting. - [Accrue.RateLimitError](Accrue.RateLimitError.md): Raised when the processor returns a rate-limit response (HTTP 429). The `retry_after` field carries the server's suggested backoff in seconds. - [Accrue.SetupDiagnostic](Accrue.SetupDiagnostic.md): Shared setup-diagnostic carrier for first-hour host misconfiguration. - [Accrue.SignatureError](Accrue.SignatureError.md): Raised when a webhook signature fails verification. This is NEVER returned as a tuple — a bad signature is either a misconfiguration or an attacker, and neither is recoverable at the call site. The webhook plug translates this raise into an HTTP 400. ## Mix Tasks - [mix accrue.gen.handler](Mix.Tasks.Accrue.Gen.Handler.md): Generates a host-owned Accrue webhook handler scaffold. Generated files are stamped with `# accrue:generated` by `Accrue.Install.Fingerprints`. - [mix accrue.install](Mix.Tasks.Accrue.Install.md): Generates host-owned Accrue wiring. - [mix accrue.webhooks.prune](Mix.Tasks.Accrue.Webhooks.Prune.md): Manually trigger the same retention sweep that `Accrue.Webhook.Pruner` runs on its Oban cron schedule. Useful for ops engineers who want to reclaim DB space without waiting for the next scheduled run. - [mix accrue.webhooks.replay](Mix.Tasks.Accrue.Webhooks.Replay.md): Requeue dead-lettered webhook events from the command line.