Billing

balena.models.billing : object

Note! The billing methods are available on Balena.io exclusively.

Kind: static namespace


changePlan

balena.models.billing.changePlan(organization, planChangeOptions)Promise

Kind: static method of billing Summary: Change the current billing plan Access: public

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

planChangeOptions

Object

an object containing the billing plan change options

billingInfo.tier

String

the code of the target billing plan

billingInfo.cycle

String

the billing cycle

[billingInfo.planChangeReason]

String

the reason for changing the current plan

Example

balena.models.billing.changePlan(orgId, { billingCode: 'prototype-v2', cycle: 'annual' }).then(function() {
	console.log('Plan changed!');
});

createSetupIntent

balena.models.billing.createSetupIntent(setupIntentParams)Promise

Kind: static method of billing Summary: Create a Stripe setup intent required for setting billing information Access: public Fulfil: Object - partial stripe setup intent object

Param
Type
Description

setupIntentParams

Object

an object containing the parameters for the setup intent creation

extraParams.organization

String | Number

handle (string) or id (number) of the target organization.

[extraParams.'g-recaptcha-response']

String | undefined

the captcha response

Example


downloadInvoice

balena.models.billing.downloadInvoice(organization)Promise

Kind: static method of billing Summary: Download a specific invoice Access: public Fulfil: Blob|ReadableStream - blob on the browser, download stream on node

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

String

an invoice number

Example


getAccount

balena.models.billing.getAccount(organization)Promise

Kind: static method of billing Summary: Get the user's billing account Access: public Fulfil: Object - billing account

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

Example


getBillingInfo

balena.models.billing.getBillingInfo(organization)Promise

Kind: static method of billing Summary: Get the current billing information Access: public Fulfil: Object - billing information

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

Example


getInvoices

balena.models.billing.getInvoices(organization)Promise

Kind: static method of billing Summary: Get the available invoices Access: public Fulfil: Object - invoices

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

Example


getPlan

balena.models.billing.getPlan(organization)Promise

Kind: static method of billing Summary: Get the current billing plan Access: public Fulfil: Object - billing plan

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

Example


removeBillingInfo

balena.models.billing.removeBillingInfo(organization)Promise

Kind: static method of billing Summary: Remove an organization's billing information Access: public

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

Example


updateAccountInfo

balena.models.billing.updateAccountInfo(organization, accountInfo)

Kind: static method of billing Summary: Update the current billing account information Access: public

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

accountInfo

AccountInfo

an object containing billing account info

Example

Example


updateBillingInfo

balena.models.billing.updateBillingInfo(organization, billingInfo)Promise

Kind: static method of billing Summary: Update the current billing information Access: public Fulfil: Object - billing information

Param
Type
Description

organization

String | Number

handle (string) or id (number) of the target organization.

billingInfo

Object

an object containing a billing info token_id

billingInfo.token_id

String

the token id generated for the billing info form

[billingInfo.'g-recaptcha-response']

String | undefined

the captcha response

[billingInfo.token_type]

String | undefined

token type

Example


Last updated

Was this helpful?