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

# Open customer portal

> Stripe-hosted portal for managing an existing subscription.

Opens the [Stripe Customer Portal](https://stripe.com/docs/billing/subscriptions/customer-portal)
so the user can update payment methods, change plan, cancel, or
download invoices, all on Stripe's hosted UI.

### Body

<ParamField body="return_url" type="string">
  Where Stripe sends the user after they close the portal. Default:
  `${origin}/Settings`.
</ParamField>

### Response

```json theme={null}
{ "url": "https://billing.stripe.com/p/session/..." }
```

The caller redirects to that URL same-tab.

### Errors

| Status | Code                     | Meaning                                                                            |
| ------ | ------------------------ | ---------------------------------------------------------------------------------- |
| 401    | `unauthenticated`        | Sign in required.                                                                  |
| 404    | `no_subscription`        | The user has never had a Stripe customer (no subscription, no past pack purchase). |
| 503    | `billing_not_configured` | `STRIPE_SECRET_KEY` not set on this deploy.                                        |
