BillingProvider
Defined in: src/billing/contract.ts:110
A billing provider adapter.
Properties
Section titled “Properties”| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id |
readonly |
string |
"stripe", "polar", "paddle", "lemonsqueezy", "manual", … (matches catalog providers keys). |
src/billing/contract.ts:112 |
Methods
Section titled “Methods”createCheckout()?
Section titled “createCheckout()?”createCheckout?(input): Promise<{ url: string;}>;Defined in: src/billing/contract.ts:118
Hosted checkout link-out.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
CheckoutInput |
Returns
Section titled “Returns”Promise<{
url: string;
}>
createPortalSession()?
Section titled “createPortalSession()?”createPortalSession?(input): Promise<{ url: string;}>;Defined in: src/billing/contract.ts:120
Hosted billing-portal link-out.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
PortalSessionInput |
Returns
Section titled “Returns”Promise<{
url: string;
}>
fetchSubscriptions()?
Section titled “fetchSubscriptions()?”fetchSubscriptions?(providerCustomer): Promise<ProviderSubscription[]>;Defined in: src/billing/contract.ts:116
Current subscriptions of a provider customer (reconcile / backfill).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
providerCustomer |
string |
Returns
Section titled “Returns”Promise<ProviderSubscription[]>
parseWebhook()?
Section titled “parseWebhook()?”parseWebhook?(request): Promise<BillingWebhook>;Defined in: src/billing/contract.ts:114
Verify the signature and normalize the payload. Throws BillingVerificationError.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request |
Request |
Returns
Section titled “Returns”Promise<BillingWebhook>
reportUsage()?
Section titled “reportUsage()?”reportUsage?(records): Promise<void>;Defined in: src/billing/contract.ts:122
Push usage to provider meters.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
records |
UsageRecord[] |
Returns
Section titled “Returns”Promise<void>