Skip to content

Create checkout session

POST
/v1/billing/checkout

Create a Stripe checkout session for upgrading to a paid plan. Returns a URL to redirect the user to Stripe’s hosted checkout page.

object
plan
required

Plan to subscribe to

string
Allowed values: starter pro business
Example
pro
interval
required

Billing interval

string
Allowed values: monthly annual
Example
monthly
Examples

Pro plan monthly

{
"plan": "pro",
"interval": "monthly"
}

Checkout session created successfully

object
data
object
session_id

Stripe checkout session ID

string
Example
cs_test_abc123
checkout_url

URL to redirect user to Stripe checkout

string format: uri
Example
https://checkout.stripe.com/c/pay/cs_test_abc123
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"data": {
"session_id": "cs_test_abc123",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_test_abc123"
},
"meta": {
"request_id": "req_xyz123"
}
}

Invalid request

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Examples

Endpoint not found

{
"error": {
"code": "ENDPOINT_NOT_FOUND",
"message": "endpoint not found"
},
"meta": {
"request_id": "req_xyz123"
}
}

Unauthorized - Invalid or missing API key

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
},
"meta": {
"request_id": "req_xyz123"
}
}

Already subscribed to a paid plan

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"error": {
"code": "ALREADY_SUBSCRIBED",
"message": "Tenant already has an active paid subscription"
},
"meta": {
"request_id": "req_xyz123"
}
}
Personalize Examples

Enter your credentials to populate code examples throughout the docs.