# Start a checkout for a paid plan

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

Makes a Stripe Checkout Session for the plan and returns the address of Stripe's hosted page.

`POST /user/billing/checkout`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Start a checkout for a paid plan. |
| What does it take? | A JSON body of type [`CheckoutBody`](https://docs.plotwork.dev/api/schemas.md#checkoutbody). |
| What does it return? | Status 200 with a body of type [`BillingUrl`](https://docs.plotwork.dev/api/schemas.md#billingurl). |
| What can go wrong? | `400` the body is not valid; `401` not signed in; `403` the request came from an origin that may not make changes; `409` the account is already on a paid plan; `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 Checkout Session for the plan and returns the address of Stripe's hosted page. An account already on a paid plan is refused with 409; the billing portal changes or ends the plan it has.

## Request body

The body has the type [`CheckoutBody`](https://docs.plotwork.dev/api/schemas.md#checkoutbody).

| Field | Type | Required | Description |
|---|---|---|---|
| `plan` | `"pro"` | yes | The plan to subscribe to. `pro` is the only paid plan. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The address of the Stripe page. | [`BillingUrl`](https://docs.plotwork.dev/api/schemas.md#billingurl) |
| 400 | The body is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 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 is already on a paid plan. | [`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 |
