Start a checkout session
POST
/billing/checkout
const url = 'https://example.com/billing/checkout';const options = { method: 'POST', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"plan":"starter"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/billing/checkout \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "plan": "starter" }'Returns a Stripe Checkout URL. The subscription itself is recorded when Stripe says it exists, not when this returns.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
plan
required
string
Responses
Section titled “Responses”Where to go
Media typeapplication/json
object
url
required
Send the person here.
string format: uri
Examplegenerated
{ "url": "https://example.com"}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not allowed to manage billing, or asking for a key to do it
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Billing is not configured on this deployment
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}