Charge calculations, pre-invoices and invoices
Between “the contract says X should be billed” and “a tax invoice for X exists” there are three distinct objects. Confusing them is the most common cause of billing errors.
- Charge calculation
- Pre-invoice
- Issued invoice
- Applied payment
Charge calculation
Sección titulada «Charge calculation»A charge calculation is the result of computing a period: contract + usage + prices + adjustments. It is not yet a document and has no tax effect.
A charge calculation can be recomputed as many times as needed. If late usage arrives, an event is corrected or the contract is adjusted before issuing, the calculation is recomputed and reflects the current state. That is precisely the moment when corrections are cheap.
Pre-invoice
Sección titulada «Pre-invoice»A pre-invoice is the detail of the charge calculation shared with the customer before issuing. It lets the customer validate it, issue their purchase order (OC, orden de compra) or obtain an internal approval.
Issuing without a pre-invoice is normal for simple contracts. For contracts that require an OC or a service acceptance sheet (HES, hoja de entrada de servicio), the pre-invoice is the step that obtains that evidence. See OC, HES and approvals.
Invoice
Sección titulada «Invoice»An invoice is a financial record. Its status is not a single value: it is four independent axes, because an invoice can be accepted by the SII (Chile’s tax authority), not yet delivered to the customer and partially paid, all at once.
Axis 1 — Lifecycle
Sección titulada «Axis 1 — Lifecycle»Where the document is in its life as a document.
| Status | Meaning |
|---|---|
upcoming |
The period has not closed yet |
draft |
Draft. Editable, no tax effect |
open |
Issued. A financial record, no longer editable |
partially_voided |
Issued and partially reversed by a credit note |
void |
Issued and then fully reversed |
cancelled |
Discarded before issuance. Never had a fiscal footprint |
The valid transitions are:
upcoming → draft → open → void open → partially_voided → voidupcoming | draft → cancelledAxis 2 — Fiscal status
Sección titulada «Axis 2 — Fiscal status»What the tax authority said about the document.
| Status | Meaning |
|---|---|
not_submitted |
Not yet submitted |
pending |
Submitted, no response yet |
accepted |
Accepted by the authority |
rejected |
Rejected. Requires correction and resubmission |
Axis 3 — Delivery
Sección titulada «Axis 3 — Delivery»Whether the document reached the customer.
| Status | Meaning |
|---|---|
not_sent |
Not sent |
send_requested |
Sending requested, still queued |
sent_to_provider |
Handed off to the email provider |
delivered |
Confirmed as delivered |
delivery_failed |
Sending failed |
send_requested does not mean “sent”: it means “queued”. The difference matters when a customer claims they never received their invoice.
Axis 4 — Payment
Sección titulada «Axis 4 — Payment»How much has been collected.
| Status | Meaning |
|---|---|
unpaid |
No payments applied |
partially_paid |
Partly paid |
paid |
Settled |
Document types
Sección titulada «Document types»| Type | Use | SII code |
|---|---|---|
| Domestic | Domestic sale | 33 (taxable, afecta) · 34 (exempt, exenta) |
| Export | Sale abroad | 110 |
| Receipt (boleta) | Sale to an end consumer | 39 · 41 (exempt) |
Every invoice records where it came from: a billing cycle (billing_run), a one-off issuance outside a contract (one_off), or an import of documents already issued in another system (imported_issued_invoice). The origin is what lets you distinguish what Relvo calculated from what Relvo only recorded.
Editing before issuing
Sección titulada «Editing before issuing»A draft can be edited: add and remove lines, group them, adjust names, correct the currency conversion. Relvo records whether the draft body is the one generated by the calculation or was edited by an operator, so that a later recalculation does not silently overwrite a deliberate manual adjustment.
Acme, July close
| Item | Amount |
|---|---|
| Platform (in advance) | USD 1,000.00 |
| AI conversations — 8,420 tiered (in arrears) | USD 639.40 |
| Invoice total | USD 1,639.40 |
One period, one document, two charges with opposite timing. A later payment of USD 1,000 leaves it partially_paid with a USD 639.40 balance.
Invoices live at /api/v1/public/invoices (scopes invoices:read and invoices:write). Actions are dedicated, named endpoints: /issue, /cancel and /duplicate. There are also subresources for lines, line-groups, commercial-references, suppressed-lines (with /restore) and versions/{version}, and downloads at /pdf and /xml. Every POST requires an Idempotency-Key, and every write to an existing invoice requires If-Match. Lists return {items, next_cursor}.