Skip to main content

Overview

The billing sub-client provides subscription management through Stripe. You can check the current subscription status, create checkout sessions for upgrades, and generate billing portal URLs for self-service management.

billing.getSubscription()

Get the current subscription status for the authenticated developer organization.

Response: SubscriptionStatus

plan
string
Current plan: 'free', 'pro', or 'enterprise'.
status
string
Subscription status: 'active', 'past_due', or 'canceled'.
currentPeriodEnd
string | null
ISO 8601 end date of the current billing period, or null for the free plan.

billing.createCheckout()

Create a Stripe Checkout session for upgrading to a paid plan. Redirect the user to the returned URL to complete the purchase.

Parameters

plan
'pro' | 'enterprise'
required
The plan to subscribe to.
successUrl
string
required
URL to redirect to after successful payment.
cancelUrl
string
required
URL to redirect to if the user cancels.

Response: CheckoutResponse

checkoutUrl
string
Stripe Checkout session URL. Redirect the user here.

billing.createPortal()

Create a Stripe Billing Portal session for self-service subscription management (update payment method, cancel, view invoices).

Parameters

returnUrl
string
required
URL to redirect back to after the user finishes in the portal.

Response: PortalResponse

portalUrl
string
Stripe Billing Portal session URL. Redirect the user here.

Full example

Last modified on February 28, 2026