Skip to main content

Billing accounts

The account that accumulates a customer's subscriptions, invoices and credits. Suspending halts billing without ending the relationship; closing ends it.

CommandHTTPDescription
billing-accounts listGET /v1/billing_accountsList billing accounts
billing-accounts createPOST /v1/billing_accountsCreate a billing account
billing-accounts getGET /v1/billing_accounts/{id}Get a billing account
billing-accounts updatePATCH /v1/billing_accounts/{id}Update a billing account
billing-accounts deleteDELETE /v1/billing_accounts/{id}Close a billing account
billing-accounts closePOST /v1/billing_accounts/{id}/closeClose a billing account (POST /close)
billing-accounts creditsGET /v1/billing_accounts/{id}/creditsList the account's credits
billing-accounts entitlementsGET /v1/billing_accounts/{id}/entitlementsList the account's entitlements
billing-accounts invoicesGET /v1/billing_accounts/{id}/invoicesList the account's invoices
billing-accounts reactivatePOST /v1/billing_accounts/{id}/reactivateReactivate a billing account
billing-accounts subscriptionsGET /v1/billing_accounts/{id}/subscriptionsList the account's subscriptions
billing-accounts suspendPOST /v1/billing_accounts/{id}/suspendSuspend a billing account

Examples​

--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.

# List billing accounts
kobana billing billing-accounts list \
--fields "id,public_id,external_id,currency,billing_email"

# Get a billing account
kobana billing billing-accounts get --params '{"id": "BILLING_ACCOUNT_ID"}'

# Create a billing account
kobana billing billing-accounts create --json '{"customer": "CUSTOMER"}'

# Update a billing account
kobana billing billing-accounts update \
--params '{"id": "BILLING_ACCOUNT_ID"}' \
--json '{"external_id": "EXTERNAL_ID", "name": "NAME", "email": "EMAIL"}'

# Close a billing account (POST /close)
kobana billing billing-accounts close \
--params '{"id": "BILLING_ACCOUNT_ID"}' \
--json '{"reason": "REASON"}'

# Close a billing account
kobana billing billing-accounts delete \
--params '{"id": "BILLING_ACCOUNT_ID"}' \
--dry-run

Next steps​