Skip to main content

kobana billing invoices

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

CommandHTTPDescription
invoices installmentsGET /v1/invoices/{id}/installmentsList invoice installments
invoices installments createPOST /v1/invoices/{id}/installmentsCreate/update installment schedule
invoices installments mark-paidPOST /v1/invoices/{id}/installments/{installment_id}/mark-paidMark installment as paid
invoices installments payPOST /v1/invoices/{id}/installments/{installment_id}/payPay installment
invoices pending-nfeGET /v1/invoices/pending-nfeList invoices with pending NF-e
invoices pending-paymentGET /v1/invoices/pending-paymentList invoices with pending payment
invoices listGET /v1/invoicesList invoices
invoices createPOST /v1/invoicesCreate invoice
invoices updatePUT /v1/invoicesUpsert invoice
invoices getGET /v1/invoices/{id}Get invoice
invoices deleteDELETE /v1/invoices/{id}Delete invoice
invoices apply-creditsPOST /v1/invoices/{id}/apply-creditsApply credits to invoice
invoices finalizePOST /v1/invoices/{id}/finalizeFinalize invoice
invoices issue-nfePOST /v1/invoices/{id}/issue-nfeIssue NF-e for invoice
invoices payPOST /v1/invoices/{id}/payPay invoice
invoices payment-methodsGET /v1/invoices/{id}/payment-methodsList available payment methods
invoices pdfGET /v1/invoices/{id}/pdfDownload invoice PDF
invoices remove-creditsPOST /v1/invoices/{id}/remove-creditsRemove applied credits
invoices send-reminderPOST /v1/invoices/{id}/send-reminderSend invoice reminder
invoices undo-paymentPOST /v1/invoices/{id}/undo-paymentUndo invoice payment
invoices voidPOST /v1/invoices/{id}/voidVoid invoice

invoices installments​

List invoice installments

kobana billing invoices installments [ID] [OPTIONS] [COMMAND]

GET /v1/invoices/{id}/installments

Path arguments: id

Responses

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

invoices installments create​

Create/update installment schedule

kobana billing invoices installments create [ID] [OPTIONS]

POST /v1/invoices/{id}/installments

Creates or replaces the invoice installment schedule. Minimum of 2 installments.

Path arguments: id

Request body

NameTypeRequiredDescription
installmentsarray<object>yesInstallment list. Minimum 2.

More fields and nested objects: kobana schema billing.invoices.installments.create.

Responses

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

invoices installments mark-paid​

Mark installment as paid

kobana billing invoices installments mark-paid [ID] [INSTALLMENT_ID] [OPTIONS]

POST /v1/invoices/{id}/installments/{installment_id}/mark-paid

Manually marks an installment as paid (reconciliation, no gateway call).

Path arguments: id, installment_id

Responses

HTTPDescription
200Installment marked as paid.
404Resource not found in the current organization.

invoices installments pay​

Pay installment

kobana billing invoices installments pay [ID] [INSTALLMENT_ID] [OPTIONS]

POST /v1/invoices/{id}/installments/{installment_id}/pay

Processes payment for a specific installment via the gateway. The previous installment must be paid.

Path arguments: id, installment_id

Request body

NameTypeRequiredDescription
payment_methodstringyesWhen provided, triggers the gateway (pix, bank_slip or card) or creates a transfer charge (bank_transfer, requires bank_account_id or pix_key_id). Omit to mark as paid manually. Values: pix, bank_slip, card, bank_transfer.
payment_method_idstring (uuid)noUUID of a saved payment method (e.g.: tokenized card).
cardobjectnoCard data when payment_method = card and no payment_method_id is provided.
bank_account_idstring (uuid)noWith payment_method = bank_transfer: UUID of the organization bank account the customer should transfer to (see /bank_accounts). Send this or pix_key_id, never both.
pix_key_idstring (uuid)noWith payment_method = bank_transfer: UUID of the organization Pix key the customer should transfer to (see /pix_keys). Send this or bank_account_id, never both.

More fields and nested objects: kobana schema billing.invoices.installments.pay.

Responses

HTTPDescription
200Installment payment result.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

invoices pending-nfe​

List invoices with pending NF-e

kobana billing invoices pending-nfe [OPTIONS]

GET /v1/invoices/pending-nfe

Returns paid invoices that still need NF-e emission β€” no NF-e, or NF-e in pending, processing or error status.

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_idstringnoFilter by billing_account_id.

Responses

HTTPDescription
200Paginated list of invoices with pending NF-e.
404Resource not found in the current organization.

invoices pending-payment​

List invoices with pending payment

kobana billing invoices pending-payment [OPTIONS]

GET /v1/invoices/pending-payment

Returns finalized invoices (status = open) past their due_date.

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_idstringnoFilter by billing_account_id.

Responses

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

invoices list​

List invoices

kobana billing invoices list [OPTIONS]

GET /v1/invoices

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

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 status: draft, open, paid, void or uncollectible. Values: draft, open, paid, void, uncollectible.
billing_account_idstringnoFilter by billing_account_id.
company_idstringnoFilter by issuing company_id.
subscription_idstringnoFilter by originating subscription_id.
due_date_fromstringnoFilter by start due_date (inclusive).
due_date_tostringnoFilter by end due_date (inclusive).
date_fromstringnoFilter by start created_at (inclusive).
date_tostringnoFilter by end created_at (inclusive).
searchstringnoFree-text search.
total_minnumber,nullnoFilter by minimum total amount, in BRL (float, up to 4 decimal places).
total_maxnumber,nullnoFilter by maximum total amount, in BRL (float, up to 4 decimal places).
document_numberstringnoFilter by customer's CPF/CNPJ.
without_paymentsstringnoWhen true, returns only invoices without associated payments. Values: true, false.
plan_filterstringnoFilter by origin: all, with_plan (subscription) or without_plan (one-off). Values: all, with_plan, without_plan.

Responses

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

invoices create​

Create invoice

kobana billing invoices create [OPTIONS]

POST /v1/invoices

Creates an invoice for a billing account. Accepts line items, optional installments (installments, minimum 2) and NF-e issuance policy.

Request body

NameTypeRequiredDescription
billing_account_idstring (uuid)yesTarget billing account UUID. Required.
line_itemsarray<object>yesLine items. Minimum 1.
external_idstringnoIdentifier in your external system, for idempotency/sync.
company_idstring (uuid)noIssuing company UUID. Default: organization's default company.
subscription_idstring (uuid)noOriginating subscription UUID.
product_group_idstring (uuid)noProduct group UUID.
collection_methodstringnoCollection method. Default: manual_invoice. Values: charge_automatically, manual_charge, manual_invoice.
due_datestringnoDue date. Default: today + the account's payment_terms_days.
descriptionstringnoFree-form description shown at the top of the invoice.
footerstringnoFree-form footer shown at the bottom of the invoice.
discountnumbernoFixed discount in BRL.
discount_descriptionstringnoDiscount description (e.g.: "20% annual payment discount").
installmentsarray<object>noInstallment schedule (minimum 2). Each item has amount and due_date.
nfe_issuance_policystringnoNF-e issuance policy for installment invoices. Values: disabled, on_finalization, on_full_payment, per_installment.
period_startstringnoStart of the billing period (auto-set for subscription invoices).
period_endstringnoEnd of the billing period (auto-set for subscription invoices).
custom_metadataobjectnoCustom fields (validated against the organization's schema).

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

Responses

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

invoices update​

Upsert invoice

kobana billing invoices update [OPTIONS]

PUT /v1/invoices

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
billing_account_idstring (uuid)noTarget billing account UUID. Required.
external_idstringnoIdentifier in your external system, for idempotency/sync.
company_idstring (uuid)noIssuing company UUID. Default: organization's default company.
subscription_idstring (uuid)noOriginating subscription UUID.
product_group_idstring (uuid)noProduct group UUID.
collection_methodstringnoCollection method. Default: manual_invoice. Values: charge_automatically, manual_charge, manual_invoice.
due_datestringnoDue date. Default: today + the account's payment_terms_days.
descriptionstringnoFree-form description shown at the top of the invoice.
footerstringnoFree-form footer shown at the bottom of the invoice.
line_itemsarray<object>noLine items. Minimum 1.
discountnumbernoFixed discount in BRL.
discount_descriptionstringnoDiscount description (e.g.: "20% annual payment discount").
installmentsarray<object>noInstallment schedule (minimum 2). Each item has amount and due_date.
nfe_issuance_policystringnoNF-e issuance policy for installment invoices. Values: disabled, on_finalization, on_full_payment, per_installment.
period_startstringnoStart of the billing period (auto-set for subscription invoices).
period_endstringnoEnd of the billing period (auto-set for subscription invoices).
custom_metadataobjectnoCustom fields (validated against the organization's schema).
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.invoices.update.

Responses

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

invoices get​

Get invoice

kobana billing invoices get [ID] [OPTIONS]

GET /v1/invoices/{id}

Path arguments: id

Responses

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

invoices delete​

Delete invoice

kobana billing invoices delete [ID] [OPTIONS]

DELETE /v1/invoices/{id}

Deletes a draft, open or void invoice (credits applied to an open invoice go back to the customer balance). A paid or uncollectible invoice cannot be deleted β€” undo the payment or void it first.

Path arguments: id

Responses

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

invoices apply-credits​

Apply credits to invoice

kobana billing invoices apply-credits [ID] [OPTIONS]

POST /v1/invoices/{id}/apply-credits

Applies billing-account credits to an open (status = open) invoice.

Path arguments: id

Request body

NameTypeRequiredDescription
credit_idsarray<string (uuid)>yesUUIDs of the credits to apply (minimum 1).
amountnumbernoAmount to apply in BRL. Default: covers the entire invoice.

More fields and nested objects: kobana schema billing.invoices.apply-credits.

Responses

HTTPDescription
200Credits applied.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

invoices finalize​

Finalize invoice

kobana billing invoices finalize [ID] [OPTIONS]

POST /v1/invoices/{id}/finalize

Finalizes a draft invoice (draft β†’ open).

Path arguments: id

Responses

HTTPDescription
200Invoice finalized.
404Resource not found in the current organization.

invoices issue-nfe​

Issue NF-e for invoice

kobana billing invoices issue-nfe [ID] [OPTIONS]

POST /v1/invoices/{id}/issue-nfe

Triggers issuance of the NF-e (Electronic Invoice) for the invoice.

Path arguments: id

Responses

HTTPDescription
200NF-e queued/issued.
404Resource not found in the current organization.

invoices pay​

Pay invoice

kobana billing invoices pay [ID] [OPTIONS]

POST /v1/invoices/{id}/pay

Two modes: (a) when payment_method is provided, creates a gateway payment (pix, bank_slip or card) and returns the method artifacts (QR code, barcode or card status) β€” or, with bank_transfer, a transfer charge to the organization bank account (bank_account_id) or Pix key (pix_key_id), with no gateway, returning the details in bank_transfer and staying pending until settled manually; (b) when omitted, marks the invoice as paid manually (reconciliation).

Path arguments: id

Request body

NameTypeRequiredDescription
payment_methodstringnoWhen provided, triggers the gateway (pix, bank_slip or card) or creates a transfer charge (bank_transfer, requires bank_account_id or pix_key_id). Omit to mark as paid manually. Values: pix, bank_slip, card, bank_transfer.
payment_method_idstring (uuid)noUUID of a saved payment method (e.g.: tokenized card).
cardobjectnoCard data when payment_method = card and no payment_method_id is provided.
bank_account_idstring (uuid)noWith payment_method = bank_transfer: UUID of the organization bank account the customer should transfer to (see /bank_accounts). Send this or pix_key_id, never both.
pix_key_idstring (uuid)noWith payment_method = bank_transfer: UUID of the organization Pix key the customer should transfer to (see /pix_keys). Send this or bank_account_id, never both.
amountnumbernoAmount to charge in BRL. Default: invoice remaining amount. Required when installment_ids is given, and must equal the sum of the selected installments' net.
installment_idsarray<string (uuid)>noUUIDs of the installments the payment covers (split invoices).

More fields and nested objects: kobana schema billing.invoices.pay.

Responses

HTTPDescription
200Payment result or invoice marked as paid.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

invoices payment-methods​

List available payment methods

kobana billing invoices payment-methods [ID] [OPTIONS]

GET /v1/invoices/{id}/payment-methods

Lists the payment methods available to pay this invoice, based on the organization's active gateways and portal settings.

Path arguments: id

Responses

HTTPDescription
200Available payment methods.
404Resource not found in the current organization.

invoices pdf​

Download invoice PDF

kobana billing invoices pdf [ID] [OPTIONS]

GET /v1/invoices/{id}/pdf

Generates and downloads the invoice PDF as a binary attachment (application/pdf).

Path arguments: id

Responses

HTTPDescription
200Invoice PDF.
404Resource not found in the current organization.

invoices remove-credits​

Remove applied credits

kobana billing invoices remove-credits [ID] [OPTIONS]

POST /v1/invoices/{id}/remove-credits

Removes all credits applied to the invoice, returning them to the billing account. Only works on open (status = open) invoices.

Path arguments: id

Responses

HTTPDescription
200Credits removed.
404Resource not found in the current organization.
422Request body failed validation.

invoices send-reminder​

Send invoice reminder

kobana billing invoices send-reminder [ID] [OPTIONS]

POST /v1/invoices/{id}/send-reminder

Sends an invoice payment reminder email to the billing account's billing_email.

Path arguments: id

Responses

HTTPDescription
200Reminder sent.
404Resource not found in the current organization.

invoices undo-payment​

Undo invoice payment

kobana billing invoices undo-payment [ID] [OPTIONS]

POST /v1/invoices/{id}/undo-payment

Reverts the invoice payment (paid β†’ open). The reason is recorded in the audit log.

Path arguments: id

Request body

NameTypeRequiredDescription
reasonstringnoReversal reason (recorded in the audit log).

More fields and nested objects: kobana schema billing.invoices.undo-payment.

Responses

HTTPDescription
200Payment undone.
404Resource not found in the current organization.

invoices void​

Void invoice

kobana billing invoices void [ID] [OPTIONS]

POST /v1/invoices/{id}/void

Voids an open invoice (open β†’ void). The reason is recorded in the audit log.

Path arguments: id

Request body

NameTypeRequiredDescription
reasonstringnoVoid reason (recorded in the audit log).

More fields and nested objects: kobana schema billing.invoices.void.

Responses

HTTPDescription
200Invoice voided.
404Resource not found in the current organization.