Skip to the documentation
API

Start a checkout

The link that buys a paid plan.

POST/billing/checkout

Runs the real call on your workspace.

POST /billing/checkout

The link that buys a paid plan.

Example

Needs billing:write. plan is starter, business or enterprise, and interval is month, the default, or year. Nothing is charged until the person pays there, and the plan starts once they have.

curl
curl -X POST "$OE/billing/checkout" -H "$AUTH" -H 'content-type: application/json' \  -d '{ "plan": "business", "interval": "year" }'
Response
{ "object": "checkout", "url": "https://checkout.example.com/c/3Hq8vXnP2sT6kL0w" }

A workspace that already pays for a plan is a 409 plan_conflict: change the plan on the billing portal instead. A plan or interval not sold on this install is a 422 plan_unavailable.

Nothing is paid through the API. The link opens the billing provider’s page, where the person pays, changes the card or cancels, as they do from the app.

An OAuth access token needs a verification code for this call. Until the app has verified one in the last 60 minutes, the call answers 403 step_up_required and changes nothing. An API key is never asked. The Authentication page shows how to ask for a code and verify it.

Reference