Skip to main content

kobana billing customers

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

CommandHTTPDescription
customers statement syncPOST /v1/customers/{id}/statement/syncRebuild the statement from history
customers statement listGET /v1/customers/{id}/statementList customer financial statement
customers users listGET /v1/customers/{id}/usersList customer portal users
customers users createPOST /v1/customers/{id}/usersInvite portal user
customers users invitePOST /v1/customers/{id}/users/inviteInvite portal user (verb)
customers users getGET /v1/customers/{id}/users/{user_id}Get portal user
customers users updatePATCH /v1/customers/{id}/users/{user_id}Update portal user
customers users deleteDELETE /v1/customers/{id}/users/{user_id}Delete portal user
customers users email-previewGET /v1/customers/{id}/users/{user_id}/email-previewPreview portal user email
customers users resendPOST /v1/customers/{id}/users/{user_id}/resendResend invitation or verification email
customers listGET /v1/customersList customers
customers createPOST /v1/customersCreate customer
customers updatePUT /v1/customersUpsert customer
customers getGET /v1/customers/{id}Get customer
customers deleteDELETE /v1/customers/{id}Remove customer (soft delete)
customers recalculate-mrrPOST /v1/customers/{id}/recalculate-mrrRecalculate customer MRR

customers statement sync​

Rebuild the statement from history

kobana billing customers statement sync [ID] [OPTIONS]

POST /v1/customers/{id}/statement/sync

Recreates statement items from existing invoices, payments and credit applications. Returns a summary of what was created.

Path arguments: id

Request body

NameTypeRequiredDescription
billing_account_idstring (uuid)noRequired when the customer has multiple billing accounts.

More fields and nested objects: kobana schema billing.customers.statement.sync.

Responses

HTTPDescription
200Statement rebuilt.
400Request body failed validation.
404Resource not found in the current organization.

customers statement list​

List customer financial statement

kobana billing customers statement list [ID] [OPTIONS]

GET /v1/customers/{id}/statement

Returns statement entries (invoices, payments, credit applications) for the customer's billing account. When the customer has multiple accounts, provide billing_account_id.

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.
billing_account_idstringnoRequired when the customer has multiple billing accounts.

Responses

HTTPDescription
200Paginated list of statement items.
400Request body failed validation.
404Resource not found in the current organization.

customers users list​

List customer portal users

kobana billing customers users list [ID] [OPTIONS]

GET /v1/customers/{id}/users

Returns portal users linked to the customer's billing account.

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.
statusstringnoFilter portal users by status. Values: active, pending_verification, pending_invitation, suspended, locked.

Responses

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

customers users create​

Invite portal user

kobana billing customers users create [ID] [OPTIONS]

POST /v1/customers/{id}/users

Creates a portal access invitation for the given email. The invitation expires in 7 days.

Path arguments: id

Request body

NameTypeRequiredDescription
emailstringyesInvitee's email (required).
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoArbitrary client-defined metadata (key/value).

More fields and nested objects: kobana schema billing.customers.users.create.

Responses

HTTPDescription
201Invitation created and email queued for sending.
400Request body failed validation.
404Resource not found in the current organization.
409A user or invitation already exists for this email.

customers users invite​

Invite portal user (verb)

kobana billing customers users invite [ID] [OPTIONS]

POST /v1/customers/{id}/users/invite

Equivalent to POST /customers/{id}/users. Available as a verb route for SDKs that prefer descriptive URLs.

Path arguments: id

Request body

NameTypeRequiredDescription
emailstringyesInvitee's email (required).
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoArbitrary client-defined metadata (key/value).

More fields and nested objects: kobana schema billing.customers.users.invite.

Responses

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

customers users get​

Get portal user

kobana billing customers users get [ID] [USER_ID] [OPTIONS]

GET /v1/customers/{id}/users/{user_id}

The {user_id} parameter accepts the user's UUID or external_id.

Path arguments: id, user_id

Responses

HTTPDescription
200Portal user detail.
404Resource not found in the current organization.

customers users update​

Update portal user

kobana billing customers users update [ID] [USER_ID] [OPTIONS]

PATCH /v1/customers/{id}/users/{user_id}

Updates email, external_id, sso_only and status. Allowed status transitions: active ↔ suspended.

Path arguments: id, user_id

Request body

NameTypeRequiredDescription
emailstringno
external_idstringno
sso_onlybooleanno
statusstringnoAllowed transitions: active ↔ suspended. Values: active, suspended.
custom_metadataobjectnoArbitrary client-defined metadata (key/value).

More fields and nested objects: kobana schema billing.customers.users.update.

Responses

HTTPDescription
200User updated.
400Request body failed validation.
404Resource not found in the current organization.

customers users delete​

Delete portal user

kobana billing customers users delete [ID] [USER_ID] [OPTIONS]

DELETE /v1/customers/{id}/users/{user_id}

Deletes the portal user (soft delete: deleted_at) β€” a pending invitation and an active user alike: access is lost at once, sessions and pending links stop working, and the email can be invited again. Requires the delete access level. Until October 2026 this route erased a pending invitation and only suspended an active user.

Path arguments: id, user_id

Responses

HTTPDescription
200Portal user deleted.
404Resource not found in the current organization.

customers users email-preview​

Preview portal user email

kobana billing customers users email-preview [ID] [USER_ID] [OPTIONS]

GET /v1/customers/{id}/users/{user_id}/email-preview

Returns the subject and body of the invitation or verification email that would be sent to the user, without actually sending it. Available only for pending_invitation or pending_verification users.

Path arguments: id, user_id

Responses

HTTPDescription
200Email preview.
400Request body failed validation.
404Resource not found in the current organization.

customers users resend​

Resend invitation or verification email

kobana billing customers users resend [ID] [USER_ID] [OPTIONS]

POST /v1/customers/{id}/users/{user_id}/resend

Resends the invitation email (for pending_invitation, rotating the token) or verification email (for pending_verification). Other statuses return 400.

Path arguments: id, user_id

Responses

HTTPDescription
200Email resent.
400Request body failed validation.
404Resource not found in the current organization.

customers list​

List customers

kobana billing customers list [OPTIONS]

GET /v1/customers

Returns a paginated list of the current organization's customers.

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.
searchstringnoFree-text search by name, document or email.
kindstringnoFilter by person kind: natural (individual) or juridical (business). Values: natural, juridical.

Responses

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

customers create​

Create customer

kobana billing customers create [OPTIONS]

POST /v1/customers

Creates a customer and, by default, an associated billing account. Use create_billing_account=false to create only the customer.

Request body

NameTypeRequiredDescription
namestringyesCustomer name (required).
public_idstring (uuid)noPublic UUID of the customer. Generated when omitted; supply one only to carry over an identifier from your system. Must be unique.
external_idstringnoExternal customer identifier in the source system.
nicknamestringno
legal_namestringnoLegal name (for businesses).
document_numberstringnoCPF or CNPJ. The document_type is inferred from the length (≀11 β†’ cpf, otherwise cnpj).
kindstringnoValues: natural, juridical.
birthdaystringnoBirth date (ISO 8601).
emailstringnoPrimary contact email.
phonestringno
notesstringno
addressesarray<object>no
phonesarray<object>no
emailsarray<object>no
websitesarray<object>no
tagsarray<string>no
custom_metadataobjectno
create_billing_accountbooleannoWhen false, doesn't automatically create a billing account. Default: true.
billing_emailstringnoEmail for sending invoices. Default: uses email when omitted.
payment_terms_daysintegernoInvoice due period in days. Default: the organization's configured default payment terms (10 when not configured).
auto_collectionbooleannoAutomatic collection on the created account. Default: true.

More fields and nested objects: kobana schema billing.customers.create.

Responses

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

customers update​

Upsert customer

kobana billing customers update [OPTIONS]

PUT /v1/customers

Takes the same body as POST and dedups on id, public_id, external_id and document_number, in that order, stopping at the first key that finds a customer. A match is updated and returns 200; otherwise the customer is created and returns 201. Updates are partial: fields absent from the body keep their stored value.

Request body

NameTypeRequiredDescription
namestringyesCustomer name. Required only when no customer is found by the dedup keys.
public_idstring (uuid)noPublic UUID of the customer. Locates the record and, when none is found, is written onto the created customer.
external_idstringnoExternal customer identifier in the source system.
nicknamestringno
legal_namestringnoLegal name (for businesses).
document_numberstringnoCPF or CNPJ. The document_type is inferred from the length (≀11 β†’ cpf, otherwise cnpj).
kindstringnoValues: natural, juridical.
birthdaystringnoBirth date (ISO 8601).
emailstringnoPrimary contact email.
phonestringno
notesstringno
addressesarray<object>no
phonesarray<object>no
emailsarray<object>no
websitesarray<object>no
tagsarray<string>no
custom_metadataobjectno
create_billing_accountbooleannoWhen false, doesn't automatically create a billing account. Default: true.
billing_emailstringnoEmail for sending invoices. Default: uses email when omitted.
payment_terms_daysintegernoInvoice due period in days. Default: the organization's configured default payment terms (10 when not configured).
auto_collectionbooleannoAutomatic collection on the created account. Default: true.
idstring (uuid)noCustomer UUID. Used only to locate the record β€” never written.
custom_metadata_modestringnoHow the submitted custom_metadata is reconciled with the stored value. replace (default) overwrites the whole object; merge deep-merges over the current value β€” nested objects merge recursively, scalars and arrays overwrite the key, and null keys are kept (they do not delete the key). Accepted on update only. Values: replace, merge.

More fields and nested objects: kobana schema billing.customers.update.

Responses

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

customers get​

Get customer

kobana billing customers get [ID] [OPTIONS]

GET /v1/customers/{id}

The {id} parameter accepts the customer UUID or its external_id.

Path arguments: id

Responses

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

customers delete​

Remove customer (soft delete)

kobana billing customers delete [ID] [OPTIONS]

DELETE /v1/customers/{id}

Marks the customer as removed without deleting historical records.

Path arguments: id

Responses

HTTPDescription
200Soft delete confirmation.
404Resource not found in the current organization.

customers recalculate-mrr​

Recalculate customer MRR

kobana billing customers recalculate-mrr [ID] [OPTIONS]

POST /v1/customers/{id}/recalculate-mrr

Recalculates the MRR (Monthly Recurring Revenue) of the customer's billing accounts from active subscriptions.

Path arguments: id

Responses

HTTPDescription
200MRR recalculated.
404Resource not found in the current organization.