Skip to content

Start a Stripe Checkout session

POST
/billing/checkout
curl --request POST \
--url https://api.sloose.com/billing/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "kind": "plan", "planKey": "free", "interval": "month", "packKey": "example", "quantity": 1, "successUrl": "example", "cancelUrl": "example" }'

For a plan subscription or a one-off credit pack. Enterprise does not self-serve: it answers { kind: "invoice" } and the subscription is billed by invoice instead.

Media typeapplication/json
object
kind
string | null
Allowed values: plan credit_pack
planKey

With kind: plan. One of team, business or enterprise.

string | null
Allowed values: free team business enterprise
interval

With kind: plan. Defaults to month.

string | null
Allowed values: month year
packKey

With kind: credit_pack.

string | null
quantity

With kind: credit_pack. Defaults to 1.

number | null
successUrl
string | null
cancelUrl
string | null
key
additional properties

A Checkout URL, or an invoice-billed subscription for Enterprise.

Media typeapplication/json
Any of:
object
kind
required
string
Allowed values: checkout
url
required

Send the browser here.

string
Example
{
"kind": "checkout"
}

kind is missing, or the plan or pack key is not one we sell.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The bearer’s role is too low, or it was issued for a different org.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

This org is a sandbox. Billing is managed on its production org.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: SANDBOX_ORG
key
additional properties
Example
{
"code": "SANDBOX_ORG"
}

Stripe is not configured on this deployment.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}