Skip to content

BillingProvider

Defined in: src/billing/contract.ts:110

A billing provider adapter.

Property Modifier Type Description Defined in
id readonly string "stripe", "polar", "paddle", "lemonsqueezy", "manual", … (matches catalog providers keys). src/billing/contract.ts:112
createCheckout?(input): Promise<{
url: string;
}>;

Defined in: src/billing/contract.ts:118

Hosted checkout link-out.

Parameter Type
input CheckoutInput

Promise<{ url: string; }>


createPortalSession?(input): Promise<{
url: string;
}>;

Defined in: src/billing/contract.ts:120

Hosted billing-portal link-out.

Parameter Type
input PortalSessionInput

Promise<{ url: string; }>


fetchSubscriptions?(providerCustomer): Promise<ProviderSubscription[]>;

Defined in: src/billing/contract.ts:116

Current subscriptions of a provider customer (reconcile / backfill).

Parameter Type
providerCustomer string

Promise<ProviderSubscription[]>


parseWebhook?(request): Promise<BillingWebhook>;

Defined in: src/billing/contract.ts:114

Verify the signature and normalize the payload. Throws BillingVerificationError.

Parameter Type
request Request

Promise<BillingWebhook>


reportUsage?(records): Promise<void>;

Defined in: src/billing/contract.ts:122

Push usage to provider meters.

Parameter Type
records UsageRecord[]

Promise<void>