Create and manage plans and payment methods.
Note for Open Source Bubbles: A Bubble launched using the open source code will still have plans, because a plan determines a lot of things (compute instance size, apps, etc). However, all plans will have a price of zero and any payment steps during registration or launch are skipped.
GET plans
Returns an array of BubblePlan objects.
GET me/paymentMethods
Returns an array of AccountPaymentMethod objects.
PUT me/paymentMethods
{
"paymentMethodType": "credit",
"paymentInfo": "{stripeToken}"
}
Create the {stripeToken}
value by tokenizing a credit card using the Stripe client libraries. In order to use the Stripe
client libraries, you'll need a Stripe public key.
Call:
GET paymentMethods
This returns an array of PaymentMethods supported by the Sage. Walk the array and find the object with "driverClass" : "bubble.cloud.payment.stripe.StripePaymentDriver"
.
Within this object, the public key is the value of the driverConfig.publicApiKey
property. It starts with pk_
.
GET me/plans
Returns an array of AccountPlan objects.
Before a Bubble can be launched, an AccountPlan must be created. After successfully creating an Account Plan, you can then launch a Bubble for the plan.
The simplest way to create a new Account Plan is:
PUT me/plans
{}
The above call will create a plan using all the default values. Note that you must pass an empty JSON object as the entity body.
To create a fully specified Account Plan:
PUT me/plans
{
"nickname": "{nick}",
"domain": "{domain}",
"locale": "{locale}",
"timezone": "{timezone}",
"plan": "{plan}",
"footprint": "{footprint}",
"sshKey": "{sshKeyUuid}",
"paymentMethodObject": {
"paymentMethodType": "credit",
"paymentInfo": "{stripeToken}"
}
}
Notes:
{nick}
can be any nickname for the plan, this will become the nickname of the Bubble. Max 100 chars.{domain}
must be thename
oruuid
of a valid BubbleDomain.- List domains with
GET me/domains
- List domains with
{locale}
must be a supported locale, ordetect
to detect locale.- To list locales: call
GET auth/configs
, the returned JSON object contains alocales
property, which is an array of strings, each representing a supported locale. - To display the name of a locale, show the value of the
locale_{locale}
message resource. For example, in theen_US
locale, the message resourcelocale_en_US
is "English (US)".
- To list locales: call
{timezone}
must be a valid time zone, ordetect
to detect time zone.- To list time zones: call
GET timezones
. Use thetimeZoneId
property when creating an Account Plan. - To display the name of a time zone, show the value of the
tz_name_{timeZoneId}
message resource, with any spaces intimeZoneId
replaced with underscores. For example, in theen_US
locale, the message resourcetz_name_America/New_York
is "America/New York".
- To list time zones: call
{plan}
must be thename
oruuid
of a BubblePlan (see "List Bubble Plans" above){footprint}
must be thename
oruuid
of a BubbleFootprint.- To list footprints: call
GET me/footprints
- To display the name of a footprint, show the value of the
footprint_name_{footprint}
message resource. For example, in theen_US
locale, the message resourcefootprint_name_Worldwide
is "World-wide". - To display the description for a footprint, show the value of the
footprint_description_{footprint}
message resource. For example, in theen_US
locale, the message resourcefootprint_description_Worldwide
is "Your Bubble can run anywhere in the world".
- To list footprints: call
{sshKey}
must be theuuid
of a valid SSH Key.- To list SSH Keys: call
GET me/keys
- To list SSH Keys: call
{paymentMethodObject}
must be a valid JSON object as described above in "Add a Payment Method"
DELETE me/plans/{uuid}
This will also stop and delete any Bubble associated with the Account Plan. All backups for the Bubble will also be deleted.