BillingOperations
Class Billing operations (Stripe).
Properties
| Name | Type | Description |
|---|---|---|
send | Send | - |
Members
constructor
(send: Send) => BillingOperations
Parameters
| Name | Type | Description |
|---|---|---|
send | Send | - |
createAuthSession
(options?: { component: string; product_id: string }) => Promise
Creates a Stripe customer session for embedded components (pricing table, buy button).
Parameters
| Name | Type | Description |
|---|---|---|
options? | { component: string; product_id: string } | - |
createPortalSession
(options?: { next_url: string; product_id: string; subscription_id: string; subscription_type: string; type: string }) => Promise
Creates a Stripe billing portal session; redirect the user to the returned url.
Parameters
| Name | Type | Description |
|---|---|---|
options? | { next_url: string; product_id: string; subscription_id: string; subscription_type: string; type: string } | - |
previewInvoice
(productId: string) => Promise
Previews the next invoice of a metered subscription (carmen or pr).
Parameters
| Name | Type | Description |
|---|---|---|
productId | string | - |
updateBillingProfile
(request: { poNumber: string; productId: "carmen" | "pr"; stripeRegion: "eu" | "us" }) => Promise
Selects the billing account (locked after first use) and maintains invoice PO numbers.
Parameters
| Name | Type | Description |
|---|---|---|
request | { poNumber: string; productId: "carmen" | "pr"; stripeRegion: "eu" | "us" } | - |
updateSubscription
(change: { action: string; product_id: string; subscription_type: string }) => Promise
Applies a subscription change (subscribe, change or cancel a product subscription).
Parameters
| Name | Type | Description |
|---|---|---|
change | { action: string; product_id: string; subscription_type: string } | - |
updateUsageCap
(request: { enabled: boolean; productId: "carmen" | "pr"; useCredits: boolean }) => Promise
Turns the usage hard cap on or off. Requires a user session (not an API-key token).
Parameters
| Name | Type | Description |
|---|---|---|
request | { enabled: boolean; productId: "carmen" | "pr"; useCredits: boolean } | - |
Source: carmen-cloud/index.ts:275