Skip to Content
kosemdocs
ReferenceAPIBilling accounts

Subscribe

Starts Pro or Team by card in Stripe Checkout, or switches a live Stripe Pro subscription to Team in place. Fails with failed_precondition, reason ALREADY_SUBSCRIBED, when already on that plan or higher.

POST
/v1/organizations/{organization}/billingAccount/subscribe

Starts Pro or Team by card in Stripe Checkout, or switches a live Stripe Pro subscription to Team in place. Fails with failed_precondition, reason ALREADY_SUBSCRIBED, when already on that plan or higher.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

organization*string

The organization's ID.

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request Body

application/json
  1. body
plan*string

The plan to subscribe to: PRO ($15 a month flat) or TEAM ($30 a builder a month).

Value in"PRO""TEAM"
returnUri*string

The console's page that Stripe's checkout returns to, with subscription=started once paid.

Response Body

OK

application/json
  1. response
checkoutUri?string

Where the browser goes to pay in Stripe's checkout; empty when an existing Pro subscription switched to Team in place.

switched?boolean

True when an existing Stripe Pro subscription switched to Team in place without a new checkout.

Example Request
curl -X POST 'https://api.kosem.ai/v1/organizations/string/billingAccount/subscribe' \
  -H 'Content-Type: application/json' \
  -d '{
  "plan": "PRO",
  "returnUri": "string"
}'
Example Response
{
  "checkoutUri": "string",
  "switched": true
}