# Credit and debit notes

> How an issued invoice is corrected without editing or deleting it.

Source: https://app.relvoerp.com/docs/product/en/credit-debit-notes/

An issued invoice is a financial record. It is not edited and it is not deleted: it is **corrected by issuing a second document** that references it. That document is either a credit note (it reduces the amount) or a debit note (it increases it).

> **Key rule: Correcting is not undoing**
>
> The original invoice still exists, can still be looked up and keeps its folio (the sequential tax document number). What changes is the net balance of the relationship with the customer, which is now invoice ± notes. An audit can reconstruct what was billed first, what was corrected afterwards and why.

## Which one to use

| Situation | Document |
| --- | --- |
| The customer was overbilled | Credit note |
| The customer was underbilled | Debit note |
| The entire document should not have been issued | Credit note for the full amount |
| The customer rejects the price and it was renegotiated | Credit note, then reinvoice |
| A discount was applied that should not have been | Debit note |

## Types and SII codes

| Document | Domestic | Export |
| --- | --- | --- |
| Credit note | 61 | 112 |
| Debit note | 56 | 111 |

The SII (Chile's tax authority) document code is neither chosen nor stored: Relvo **derives** it from the note type and from whether the transaction is domestic or export. A manually stored code can contradict the document; a derived code cannot.

## Scope of a credit note

A credit note declares how much of the source document it reverses:

| Scope | Effect | SII reference |
| --- | --- | --- |
| Full | Reverses the entire invoice | CodRef 1 — *Anula documento* (voids document) |
| Partial | Corrects amounts | CodRef 3 — *Corrige montos* (corrects amounts) |

> **Caution: The declared scope must match the amount**
>
> Relvo cross-checks what you declare against what the lines add up to. A **full** note whose lines add up to less than the invoice total is rejected, and so is a **partial** note that adds up to the full total. The inconsistency is stopped when the note is created, not after the SII has accepted it.
>
> The SII reference code is resolved on the server from the scope. It is never accepted from the client.

## Effect on the invoice

A credit note modifies the lifecycle axis of the invoice it corrects:

- **Partial** note → the invoice moves to `partially_voided`. It stays live, with a reduced balance.
- **Full** note → the invoice moves to `void`. Issued and reversed.

See [the four status axes](https://app.relvoerp.com/docs/product/en/invoicing-collections.md#invoice).

## Note lifecycle

A note is itself a tax document with its own axes:

```
Lifecycle        draft → open → void
Fiscal           pending → accepted | rejected
Delivery         not_sent → sent | failed
```

A draft note can be corrected. An issued note cannot: if a credit note went out wrong, it is corrected with a debit note. The chain of corrections remains intact in the record.

**Example: Acme, July correction**

The July invoice charges the fixed platform fee (USD 1,000) plus 8,420 conversations at USD 0.075 (USD 631.50). The customer shows that 420 of them were internal tests by its own team, not billable usage: 420 × USD 0.075 = USD 31.50.

| Document | Amount | Effect |
| --- | --- | --- |
| Invoice 33 no. 1841 | USD 1,631.50 | `open` |
| Credit note 61, partial | USD 31.50 | Invoice → `partially_voided` |
| **Net balance** | **USD 1,600.00** | |

The original invoice keeps its folio and its amount. It is not touched. The receivable balance is the sum of both documents.

## Usage corrected after issuance

If a usage event is voided or replaced after the period has already been invoiced, the recalculation does **not** rewrite the invoice. Relvo flags that an adjustment is required, and that adjustment is a note. See [event corrections](https://app.relvoerp.com/docs/product/en/usage-billing.md#corrections).

## References

Every note points to the document it corrects through a commercial reference with its type, folio and date. This is what allows the SII, the customer and accounting to link both documents. See [POs, HES and commercial references](https://app.relvoerp.com/docs/product/en/approvals-commercial-references.md).

## API

Notes live at `/api/v1/public/credit-notes` and `/api/v1/public/debit-notes`, with the `invoices:read` and `invoices:write` scopes. They are created as drafts with a `POST` on the collection, which requires `Idempotency-Key` and an `If-Match` with the version of the source invoice. They are then issued with `/issue`, voided with `/void` and downloaded from `/pdf` and `/xml`. A draft is deleted with `DELETE`. Every `POST` requires `Idempotency-Key`, and every write to an existing note requires `If-Match`.

- [Charge calculations, pre-invoices and invoices](https://app.relvoerp.com/docs/product/en/invoicing-collections.md): The four status axes of an invoice.
- [Usage and billable metrics](https://app.relvoerp.com/docs/product/en/usage-billing.md): How events already ingested are corrected.
- [POs, HES and approvals](https://app.relvoerp.com/docs/product/en/approvals-commercial-references.md): Commercial references between documents.
