Invoices
Create, manage, and track invoices through the API.
Overview
Invoices are the core billing documents in Corebill. They support line items, taxes, discounts, and payment tracking. Invoice numbers are auto-generated using your company's configured prefix.
Create an Invoice
Invoice Numbers
Numbers are generated automatically: {PREFIX}-{YEAR}-{COUNTER}
Example: INV-2026-000001
The prefix is configurable per company (default: INV).
A company can have several series (Settings > Prefixes). The number is assigned when the invoice is issued, with the default series or the one in series_id. List them with GET /v1/document-series?type=invoice and send series_id when creating the invoice.
Buyer
For a sale to a generic customer (walk-in), send buyer with the name and document of whoever buys: { "name": "Maria Lopez", "tax_id": "45578923", "tax_id_type": "1" }. No customer is created; the PDF and the official document use the buyer. tax_id_type uses the same codes as the customer identity document type (0, 1, 4, 6, 7). The invoice returns it in buyer.
Statuses
| Status | Description |
|---|---|
draft | Initial state, fully editable |
sent | Sent to the customer |
viewed | Customer has viewed the invoice |
in_review | Under review |
partial | Partially paid |
paid | Fully paid |
overdue | Past due date, unpaid |
cancelled | Cancelled |
refunded | Fully or partially refunded |
Calculations
Totals are calculated automatically when creating an invoice with items:
Amounts
All monetary amounts are in the major unit of the currency with 2 decimals (major unit, 2 decimals). $1,234.56 is represented as 1234.56, never as cents (123456).
Send an Invoice
Record a Payment
The invoice status transitions automatically: partial when partially paid, paid when fully paid.
Cancel an Invoice
Refund an Invoice
If amount is omitted, the full paid amount is refunded.
Editing Restrictions
- Draft invoices: All fields can be updated
- Non-draft invoices: Only
notes,payment_terms, andstatuscan be updated
Deleting Invoices
Invoices with status paid cannot be deleted. You must cancel them first.