# Open the Stripe billing portal

> Page: https://docs.plotwork.dev/api/post-user-billing-portal. Index of every page: https://docs.plotwork.dev/llms.txt

Makes a Stripe Billing Portal session for the account and returns its address.

`POST /user/billing/portal`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Open the Stripe billing portal. |
| What does it take? | Nothing. |
| What does it return? | Status 200 with a body of type [`BillingUrl`](https://docs.plotwork.dev/api/schemas.md#billingurl). |
| What can go wrong? | `401` not signed in; `403` the request came from an origin that may not make changes; `409` the account has no billing details at stripe yet; `429` too many requests; `502` stripe could not complete the request; `503` billing is not set up on this server. Every failure uses the one error envelope. |

## What it does

Makes a Stripe Billing Portal session for the account and returns its address. An account that never started a checkout has no billing details yet and gets 409.

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The address of the Stripe page. | [`BillingUrl`](https://docs.plotwork.dev/api/schemas.md#billingurl) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | The request came from an origin that may not make changes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 409 | The account has no billing details at Stripe yet. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 502 | Stripe could not complete the request. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Billing is not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`BillingUrl`](https://docs.plotwork.dev/api/schemas.md#billingurl).

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | yes | An address on Stripe's own site. Send the browser there; it expires, so do not store it. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
