Start a checkout for a plan
POST
/api/billing/checkout
const url = 'https://forge.example.com/api/billing/checkout';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"planCode":"example","quantity":1,"period":"example","packs":[{"code":"example","quantity":1}]}'};
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://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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
planCode
required
string
quantity
required
null | integer | string format: int32
period
required
null | string
packs
required
Array<object> | null
object
code
required
null | string
quantity
required
null | integer | string format: int32
Example generated
{ "planCode": "example", "quantity": 1, "period": "example", "packs": [ { "code": "example", "quantity": 1 } ]}Responses
Section titled “Responses”OK
Media typeapplication/json
object
url
required
string
Example generated
{ "url": "example"}default
Section titled “default”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"}