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
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
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
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
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
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
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
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
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
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
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?