Overview
Thebilling 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
string
Current plan:
'free', 'pro', or 'enterprise'.string
Subscription status:
'active', 'past_due', or 'canceled'.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
'pro' | 'enterprise'
required
The plan to subscribe to.
string
required
URL to redirect to after successful payment.
string
required
URL to redirect to if the user cancels.
Response: CheckoutResponse
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
string
required
URL to redirect back to after the user finishes in the portal.
Response: PortalResponse
string
Stripe Billing Portal session URL. Redirect the user here.