Skip to content

Start a checkout for a plan

POST
/api/billing/checkout
curl --request POST \
--url https://forge.example.com/api/billing/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "planCode": "example", "quantity": 1, "period": "example", "packs": [ { "code": "example", "quantity": 1 } ] }'

For an organization with no plan in force: a trial, one whose plan has ended, or one that never had one. Send the plan’s planCode, quantity for a plan sold by the seat, period (year or month, where the plan is sold that way) and any packs to add, each with its code and quantity. Answers url, the address of Stripe’s own payment page; the plan is given when Stripe confirms the payment, not when the person comes back. A trial that pays keeps everything it made. 409 when card payment is not set up on the instance, when the price table is not approved, or when the organization has a plan already. For administrators.

Media typeapplication/json
object
planCode
required
string
quantity
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
period
required
null | string
packs
required
Array<object> | null
object
code
required
null | string
quantity
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"planCode": "example",
"quantity": 1,
"period": "example",
"packs": [
{
"code": "example",
"quantity": 1
}
]
}

OK

Media typeapplication/json
object
url
required
string

Example generated

{
"url": "example"
}

A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.

Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}