> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ouraicalling.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe & Stripe Connect

> Payments for platform plans — and how tenants charge their own customers

The platform uses Stripe as the payment rail on two levels: the **platform account** for direct customers, and **Stripe Connect** so each tenant can charge their end customers under their own name.

## Platform payments (direct users)

* **Plan subscriptions** — recurring billing via Stripe Checkout; each paid invoice resets the included plan credits on the active workspace's [balance](/admin/balances-and-transfers).
* **Credit top-ups** — one-off Checkout payments credited only to the active workspace.
* **Number fees** — monthly charges for purchased phone numbers.
* **Customer portal** — users manage payment methods, invoices, and cancellations in the Stripe-hosted portal.

Payment events are processed idempotently: a retried webhook can never double-credit a workspace or duplicate its subscription. Checkout and portal returns use the verified domain on which the customer started billing.

## Stripe Connect (tenants)

Tenants monetize their own users through connected accounts; funds settle on the connected account while the platform collects its application fee:

<Steps>
  <Step title="Onboard">
    In the tenant admin area, **Billing platform** creates a controller-based connected account with access to the full Stripe Dashboard and starts hosted onboarding. Stripe collects the tenant's business details and payout account; the page shows live onboarding status.
  </Step>

  <Step title="Create plans and sync them">
    The tenant defines [their own plans](/admin/plans-and-limits) with their own prices. Each plan is synced as a product/price onto the tenant's Connect account.
  </Step>

  <Step title="End customers pay the tenant">
    Checkout for a tenant plan charges **on the tenant's Connect account**. The platform automatically deducts an **application fee** representing the platform's costs/margin; the rest belongs to the tenant.
  </Step>
</Steps>

## Margin transparency

Because the platform knows both sides — the tenant's plan price and the platform's per-minute cost charged to the tenant — the tenant admin sees the **margin per plan** and a monthly **profit overview** (revenue − platform costs). Pricing decisions stop being guesswork.

## For platform operators

Two webhook endpoints must be configured in the Stripe dashboard: one for **events on your account** (`checkout.session.completed`, subscription updated/deleted, invoice paid/failed, and `payment_intent.succeeded` for auto top-up) and one for **events on connected accounts** (the subscription set plus `account.updated` for onboarding status). Both endpoints verify signatures and register every event id, making processing idempotent by construction.
