platform-api
Billing & Subscriptions
Overview
OrbioCloud billing lets your end users subscribe to your plans via Stripe Checkout. Your tenant is the merchant of record — payments go through your Stripe Connect account, not OrbioCloud's. You create products and prices in your own Stripe dashboard.
Prerequisites
Your tenant must have an active OrbioPay (Stripe Connect) account
Create products and prices in your Stripe dashboard
The price_id must exist on your connected Stripe account
Create Checkout Session
const { checkout_url } = await orbio.billing.createCheckout({
price_id: 'price_xxx', // Your Stripe price ID
success_url: 'https://yourapp.com/success',
cancel_url: 'https://yourapp.com/cancel',
});
// Redirect user to checkout_url
window.location.href = checkout_url;Check Subscription Status
const sub = await orbio.billing.getSubscription();
// sub.status: 'active' | 'past_due' | 'canceled' | 'trialing' | 'paused' | 'inactive'
if (sub.status === 'active') {
// User has an active subscription
}Customer Portal
const { portal_url } = await orbio.billing.createPortalSession(
'https://yourapp.com/account' // return URL
);
// Redirect to Stripe Customer Portal for self-service
// Users can update payment method, cancel, or change plans
window.location.href = portal_url;