BillingOperations
Module: carmen_cloud_client.carmen_cloud.client
Bases: _Operations
Billing operations (Stripe).
Methods
update_subscription
def update_subscription(self, action: str, product_id: str, subscription_type: str) -> Workspace
Applies a subscription change (subscribe, change or cancel a product subscription).
update_billing_profile
def update_billing_profile(self, request: Union[BillingProfileRequest, dict]) -> BillingProfile
Selects the billing account (locked after first use) and maintains invoice PO numbers.
create_auth_session
def create_auth_session(self, component: Optional[str]=None, product_id: Optional[str]=None) -> BillingAuthSession
Creates a Stripe customer session for embedded components (pricing table, buy button).
create_portal_session
def create_portal_session(self, **options: Optional[str]) -> BillingPortalSession
Creates a Stripe billing portal session; redirect the user to the returned url.
Keyword arguments are the query parameters: next_url, type,
product_id, subscription_type, subscription_id.
update_usage_cap
def update_usage_cap(self, request: Union[UsageCapRequest, dict]) -> UsageCapResult
Turns the usage hard cap on or off. Requires a user session (not an API-key token).
preview_invoice
def preview_invoice(self, product_id: str) -> InvoicePreview
Previews the next invoice of a metered subscription (carmen or pr).