Skip to main content

kobana billing billing-accounts

Commands of kobana billing billing-accounts. Every global option (Global options) applies here.

CommandHTTPDescription
billing-accounts listGET /v1/billing_accountsList billing accounts
billing-accounts createPOST /v1/billing_accountsCreate billing account
billing-accounts updatePUT /v1/billing_accountsUpsert billing account
billing-accounts getGET /v1/billing_accounts/{id}Get billing account
billing-accounts deleteDELETE /v1/billing_accounts/{id}Delete billing account
billing-accounts closePOST /v1/billing_accounts/{id}/closeClose billing account
billing-accounts creditsGET /v1/billing_accounts/{id}/creditsList billing account credits
billing-accounts entitlementsGET /v1/billing_accounts/{id}/entitlementsList billing account entitlements
billing-accounts invoicesGET /v1/billing_accounts/{id}/invoicesList billing account invoices
billing-accounts reactivatePOST /v1/billing_accounts/{id}/reactivateReactivate billing account
billing-accounts subscriptionsGET /v1/billing_accounts/{id}/subscriptionsList billing account subscriptions
billing-accounts suspendPOST /v1/billing_accounts/{id}/suspendSuspend billing account

billing-accounts list​

List billing accounts

kobana billing billing-accounts list [OPTIONS]

GET /v1/billing_accounts

Returns a paginated list of the current organization's billing accounts.

Query parameters

NameTypeRequiredDescription
pageintegernoPage (starts at 1). Default: 1.
per_pageintegernoItems per page. Default: 20. Maximum: 100.
sort_bystringnoSort field. Default depends on the resource.
sort_orderstringnoSort direction. Default: desc. Values: asc, desc.
statusstringnoFilter by billing account status. Values: active, suspended, closed.
searchstringnoFree-text search.
external_idstringnoFilter by the external identifier of the account.
currencystringnoFilter by ISO 4217 currency (e.g.: BRL).
auto_collectionstringnoFilter by automatic collection enabled (true) or disabled (false). Values: true, false.
tax_exemptstringnoFilter tax-exempt accounts (true) or non-exempt (false). Values: true, false.
customer_tax_typestringnoFilter by customer tax type.
balance_minnumber,nullnoMinimum account balance in BRL (float, up to 4 decimal places).
balance_maxnumber,nullnoMaximum account balance in BRL (float, up to 4 decimal places).
mrr_minnumber,nullnoMinimum MRR in BRL (float, up to 4 decimal places).
mrr_maxnumber,nullnoMaximum MRR in BRL (float, up to 4 decimal places).
allowed_negative_balance_minnumber,nullnoMinimum allowed negative balance in BRL (float, up to 4 decimal places).
allowed_negative_balance_maxnumber,nullnoMaximum allowed negative balance in BRL (float, up to 4 decimal places).
created_afterstringnoStart of creation date range (YYYY-MM-DD).
created_beforestringnoEnd of creation date range (YYYY-MM-DD).
updated_afterstringnoStart of update date range (YYYY-MM-DD).
updated_beforestringnoEnd of update date range (YYYY-MM-DD).
suspended_afterstringnoFilter accounts suspended from this date onwards (format YYYY-MM-DD).
suspended_beforestringnoFilter accounts suspended up to this date (format YYYY-MM-DD).
person_idstringnoFilter by associated person UUID.
person_document_numberstringnoFilter by person CPF/CNPJ (exact match).
person_name_containsstringnoFilter by person name (partial search, case-insensitive).

Responses

HTTPDescription
200Paginated list of billing accounts.
404Resource not found in the current organization.

billing-accounts create​

Create billing account

kobana billing billing-accounts create [OPTIONS]

POST /v1/billing_accounts

Creates a billing account associated with a customer. The customer block locates an existing customer by id, external_id or document_number; when not found, creates a new one (requires name and document_number).

Request body

NameTypeRequiredDescription
customerobjectyes
external_idstringnoExternal identifier for the account in the client's system.
billing_emailstring (email)noBilling email. Default: customer.email.
payment_terms_daysintegernoInvoice due period in days (1–90). Default: the organization's configured default payment terms (10 when not configured).
auto_collectionbooleannoEnables automatic collection. Default: true.
custom_metadataobjectnoArbitrary client-defined metadata (key/value).

More fields and nested objects: kobana schema billing.billing-accounts.create.

Responses

HTTPDescription
201Billing account created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

billing-accounts update​

Upsert billing account

kobana billing billing-accounts update [OPTIONS]

PUT /v1/billing_accounts

Takes the same body as POST, plus id and public_id, and dedups on id, public_id, external_id and the resource's natural keys, in that order, stopping at the first key that finds a record. A match is updated and returns 200; otherwise the record is created and returns 201. The POST's required fields are required only when no record is found, and updates are partial: absent fields keep their stored value.

Request body

NameTypeRequiredDescription
customerobjectno
external_idstringnoExternal identifier for the account in the client's system.
billing_emailstring (email)noBilling email. Default: customer.email.
payment_terms_daysintegernoInvoice due period in days (1–90). Default: the organization's configured default payment terms (10 when not configured).
auto_collectionbooleannoEnables automatic collection. Default: true.
custom_metadataobjectnoArbitrary client-defined metadata (key/value).
idstring (uuid)noRecord UUID. Used only to locate it — never written.
public_idstring (uuid)noPublic UUID of the record, used to locate it.

More fields and nested objects: kobana schema billing.billing-accounts.update.

Responses

HTTPDescription
200Record updated.
201Record created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

billing-accounts get​

Get billing account

kobana billing billing-accounts get [ID] [OPTIONS]

GET /v1/billing_accounts/{id}

Path arguments: id

Responses

HTTPDescription
200Billing account detail.
404Resource not found in the current organization.

billing-accounts delete​

Delete billing account

kobana billing billing-accounts delete [ID] [OPTIONS]

DELETE /v1/billing_accounts/{id}

Deletes the billing account (soft delete: deleted_at), together with its payment methods, cards, portal users and files — all of them disappear from every read; issued invoices, payments and NFS-e stay in the history. Requires the delete access level. Answers 422 while a subscription is not canceled, an invoice is draft or open, or a payment is pending. Until October 2026 this route closed the account (and took ?reason=) — closing is POST /v1/billing_accounts/{id}/close, reversible.

Path arguments: id

Responses

HTTPDescription
200Billing account deleted.
404Resource not found in the current organization.
422Request body failed validation.

billing-accounts close​

Close billing account

kobana billing billing-accounts close [ID] [OPTIONS]

POST /v1/billing_accounts/{id}/close

Closes the billing account. The reason is recorded in the audit log.

Path arguments: id

Request body

NameTypeRequiredDescription
reasonstringnoOperation reason (recorded in the audit log).

More fields and nested objects: kobana schema billing.billing-accounts.close.

Responses

HTTPDescription
200Billing account closed.
404Resource not found in the current organization.

billing-accounts credits​

List billing account credits

kobana billing billing-accounts credits [ID] [OPTIONS]

GET /v1/billing_accounts/{id}/credits

Returns a paginated list of the billing account's credits.

Path arguments: id

Query parameters

NameTypeRequiredDescription
pageintegernoPage (starts at 1). Default: 1.
per_pageintegernoItems per page. Default: 20. Maximum: 100.
sort_bystringnoSort field. Default depends on the resource.
sort_orderstringnoSort direction. Default: desc. Values: asc, desc.
include_expiredstringnoIncludes expired credits when true. Values: true, false.

Responses

HTTPDescription
200Paginated list of credits.
404Resource not found in the current organization.

billing-accounts entitlements​

List billing account entitlements

kobana billing billing-accounts entitlements [ID] [OPTIONS]

GET /v1/billing_accounts/{id}/entitlements

Returns a lean list of the products a billing account is entitled to, based on subscriptions that are trialing, active, or past due (dunning grace). Only parent products are returned; child (add-on) products are rolled up under their parent and omitted. Ideal for gating a product's usage in an external app.

Path arguments: id

Query parameters

NameTypeRequiredDescription
product_group_idstringnoFilters contracted products by family (product group), by ID.
product_group_slugstringnoFilters contracted products by family (product group), by slug.

Responses

HTTPDescription
200List of contracted products.
404Resource not found in the current organization.

billing-accounts invoices​

List billing account invoices

kobana billing billing-accounts invoices [ID] [OPTIONS]

GET /v1/billing_accounts/{id}/invoices

Returns a paginated list of the billing account's invoices.

Path arguments: id

Query parameters

NameTypeRequiredDescription
pageintegernoPage (starts at 1). Default: 1.
per_pageintegernoItems per page. Default: 20. Maximum: 100.
sort_bystringnoSort field. Default depends on the resource.
sort_orderstringnoSort direction. Default: desc. Values: asc, desc.

Responses

HTTPDescription
200Paginated list of invoices.
404Resource not found in the current organization.

billing-accounts reactivate​

Reactivate billing account

kobana billing billing-accounts reactivate [ID] [OPTIONS]

POST /v1/billing_accounts/{id}/reactivate

Reactivates a suspended billing account.

Path arguments: id

Responses

HTTPDescription
200Billing account reactivated.
404Resource not found in the current organization.

billing-accounts subscriptions​

List billing account subscriptions

kobana billing billing-accounts subscriptions [ID] [OPTIONS]

GET /v1/billing_accounts/{id}/subscriptions

Returns a paginated list of the billing account's subscriptions.

Path arguments: id

Query parameters

NameTypeRequiredDescription
pageintegernoPage (starts at 1). Default: 1.
per_pageintegernoItems per page. Default: 20. Maximum: 100.
sort_bystringnoSort field. Default depends on the resource.
sort_orderstringnoSort direction. Default: desc. Values: asc, desc.

Responses

HTTPDescription
200Paginated list of subscriptions.
404Resource not found in the current organization.

billing-accounts suspend​

Suspend billing account

kobana billing billing-accounts suspend [ID] [OPTIONS]

POST /v1/billing_accounts/{id}/suspend

Suspends the account. The reason is recorded in the audit log.

Path arguments: id

Request body

NameTypeRequiredDescription
reasonstringnoOperation reason (recorded in the audit log).

More fields and nested objects: kobana schema billing.billing-accounts.suspend.

Responses

HTTPDescription
200Billing account suspended.
404Resource not found in the current organization.