Skip to content
Connect an agent
Billing

Start a checkout for a paid plan

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

POST/user/billing/checkout

TL;DR

QuestionAnswer
What does it do?Start a checkout for a paid plan.
What does it take?A JSON body of type CheckoutBody.
What does it return?Status 200 with a body of type 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.

FieldTypeRequiredDescription
plan"pro"yesThe plan to subscribe to. pro is the only paid plan.

Responses

StatusMeaningBody
200The address of the Stripe page.BillingUrl
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403The request came from an origin that may not make changes.ErrorResponse
409The account is already on a paid plan.ErrorResponse
429Too many requests.ErrorResponse
502Stripe could not complete the request.ErrorResponse
503Billing is not set up on this server.ErrorResponse

Response body

A 200 answer has the type BillingUrl.

FieldTypeRequiredDescription
urlstringyesAn address on Stripe's own site. Send the browser there; it expires, so do not store it.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools