@xtandard/entitlements/billing
The billing intake and port (ADR 0007): createBilling(ent, { providers })
verifies provider webhooks, maps provider items to catalog plans and
converges subscription state; createUsageExporter forwards usage to
provider meters. Provider adapters live at billing/stripe,
billing/polar, billing/paddle, billing/lemonsqueezy,
billing/better-auth and billing/manual.
import { … } from "@xtandard/entitlements/billing";Functions
Section titled “Functions”| Name | Summary |
|---|---|
createBilling |
Bind billing providers to an engine. The returned EntitlementsBilling is what the panel’s POST /webhooks/:provider, /api/portal/checkout|manage and /api/customers/:id/reconcile routes call. |
createUsageExporter |
Export usage from onUsage to provider.reportUsage, batched. |
Classes
Section titled “Classes”| Name | Summary |
|---|---|
BillingApiError |
A provider REST call failed (non-2xx or unusable response). Carries the HTTP status. |
Interfaces
Section titled “Interfaces”| Name | Summary |
|---|---|
BillingOptions |
Options for createBilling. |
ProviderHttpOptions |
Options shared by every provider’s REST client. |
UsageExporter |
What createUsageExporter returns. |
UsageExporterOptions |
Options for createUsageExporter. |
Type aliases
Section titled “Type aliases”| Name | Summary |
|---|---|
FetchLike |
A fetch-compatible function (injectable for tests). |
UnmappedEvent |
Why BillingOptions.onUnmapped was called. |