Skip to main content

Invoices

The document to be charged, from draft to paid. finalize seals the draft, pay records settlement, void cancels it, and instalments live under installments.

CommandHTTPDescription
invoices listGET /v1/invoicesList invoices
invoices createPOST /v1/invoicesCreate an invoice
invoices getGET /v1/invoices/{id}Get an invoice
invoices updatePATCH /v1/invoices/{id}Update an invoice
invoices deleteDELETE /v1/invoices/{id}Delete an invoice
invoices apply-creditsPOST /v1/invoices/{id}/apply-creditsApply credits to an invoice
invoices finalizePOST /v1/invoices/{id}/finalizeFinalize an invoice
invoices issue-nfePOST /v1/invoices/{id}/issue-nfeIssue an NF-e for an invoice
invoices payPOST /v1/invoices/{id}/payPay an invoice
invoices payment-methodsGET /v1/invoices/{id}/payment-methodsList available payment methods
invoices pdfGET /v1/invoices/{id}/pdfDownload the invoice PDF
invoices remove-creditsPOST /v1/invoices/{id}/remove-creditsRemove applied credits
invoices send-reminderPOST /v1/invoices/{id}/send-reminderSend a billing reminder
invoices undo-paymentPOST /v1/invoices/{id}/undo-paymentUndo the invoice's payment
invoices voidPOST /v1/invoices/{id}/voidVoid an invoice
invoices installments getGET /v1/invoices/{id}/installmentsList the invoice's instalments
invoices installments createPOST /v1/invoices/{id}/installmentsCreate/update an instalment plan
invoices installments mark-paidPOST /v1/invoices/{id}/installments/{installmentId}/mark-paidMark an instalment as paid
invoices installments payPOST /v1/invoices/{id}/installments/{installmentId}/payPay an instalment
invoices pending-nfe listGET /v1/invoices/pending-nfeList invoices with a pending NF-e
invoices pending-payment listGET /v1/invoices/pending-paymentList invoices with a pending payment

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 invoices
kobana billing invoices list \
--fields "id,public_id,external_id,number,billing_account_id"

# Get an invoice
kobana billing invoices get --params '{"id": "INVOICE_ID"}'

# Create an invoice
kobana billing invoices create \
--json '{"billing_account_id": "BILLING_ACCOUNT_ID", "line_items": []}'

# Update an invoice
kobana billing invoices update \
--params '{"id": "INVOICE_ID"}' \
--json '{"external_id": "EXTERNAL_ID", "company_id": "COMPANY_ID", "collection_method": "charge_automatically"}'

# Apply credits to an invoice
kobana billing invoices apply-credits \
--params '{"id": "INVOICE_ID"}' \
--json '{"credit_ids": []}'

# Delete an invoice
kobana billing invoices delete --params '{"id": "INVOICE_ID"}' --dry-run

Next steps​