Skip to content

Create a checkout session

POST
/api/workspaces/{workspaceId}/billing/checkout
curl --request POST \
--url http://localhost:8080/api/workspaces/example/billing/checkout \
--header 'Content-Type: application/json' \
--cookie auth_session=<auth_session> \
--data '{ "successUrl": "https://example.com", "cancelUrl": "https://example.com", "returnUrl": "https://example.com" }'
workspaceId
required
string
Media typeapplication/json
object
successUrl
string format: uri
cancelUrl
string format: uri
returnUrl
string format: uri

Example generated

{
"successUrl": "https://example.com",
"cancelUrl": "https://example.com",
"returnUrl": "https://example.com"
}

Stripe-hosted URL to redirect the user to.

Media typeapplication/json
object
url
required
string format: uri

Example generated

{
"url": "https://example.com"
}

Invalid request

Media typeapplication/json
object
success
boolean
error
required
string

Example

{
"error": "Human-readable error message"
}

Authentication required

Media typeapplication/json
object
success
boolean
error
required
string

Example

{
"error": "Human-readable error message"
}

Forbidden

Media typeapplication/json
object
success
boolean
error
required
string

Example

{
"error": "Human-readable error message"
}

Not found

Media typeapplication/json
object
success
boolean
error
required
string

Example

{
"error": "Human-readable error message"
}

Conflict

Media typeapplication/json
object
success
boolean
error
required
string

Example

{
"error": "Human-readable error message"
}

Internal server error

Media typeapplication/json
object
success
boolean
error
required
string

Example

{
"error": "Human-readable error message"
}